Time-Versioned Configuration Store With Point-in-Time Reads

Last updated: November 29, 2026

Quick Overview

Design a class that stores dynamic configuration properties where every set or delete carries a timestamp, and supports get(key, ts) returning the value in effect at time ts and snapshot(ts) returning all live properties at that time.

Netflix
Coding & Algorithms
Software Engineer
Netflix
November 29, 2026
Software Engineer
Onsite
Coding & Algorithms
Medium

0

0

0 solved


Design a class that stores dynamic configuration properties where every set or delete carries a timestamp, and supports get(key, ts) returning the value in effect at time ts and snapshot(ts) returning all live properties at that time.

Netflix services read dynamic properties at runtime (the Archaius style of configuration), and during incident review engineers need to know exactly what config was live at a given moment. The interviewer looks for a clean API, binary search on per-key histories, tombstones for deletes, and sensible behavior for out-of-order writes.

What the Interviewer Expects
  • Store per-key sorted timestamp lists with aligned values
  • Use bisect_right to find the latest write at or before ts
  • Represent deletes as tombstones rather than removing history
  • Handle same-timestamp overwrites and out-of-order writes
  • Discuss memory growth and compaction
Key Topics to Cover
binary search
design a data structure
versioning
tombstones
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • How would you compact history older than 30 days while keeping reads correct?
  • How would you make snapshot fast when there are millions of keys?
  • What changes if many processes write concurrently across regions?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements

Operations: set(key, value, ts), delete(key, ts), get(key, ts), snapshot(ts). Reads return the value of the latest write with timestamp <= ts, or None if there is none or it was a delete. Writes usual...

High-Level Design

Keep two dicts keyed by property name: a sorted list of timestamps and an aligned list of values. A sentinel object marks deletions. get does bisect_right(times, ts) - 1. snapshot calls get for each k...


Submit Your Answer
Markdown supported

Related Questions