Design a Versioned KV Store with Time Travel
PUT, GET, and DELETE on a distributed store reads like a warm-up, and then the versioning clause turns it into the real question: a global commit order, point-in-time reads, and strong consistency. A client must be able to ask both "what is this key now" and "what was this key as of 9am last Tuesday," and get an exact answer. Meanwhile a hundred nodes serve millions of keys and writes never stop. The requirement that a read can travel backward in time rules out the obvious design where a key maps to one current value that each write overwrites. Once you have to answer the past, you can never throw it away on write.
So the spine of the answer is multi-versioning over immutable data. A PUT does not mutate a key in place; it appends a new version of that key, stamped with a commit order, and the old version stays exactly where it was. A GET with no timestamp returns the newest version. A GET as of a past time returns the newest version that committed at or before that time. A DELETE writes a tombstone version and erases nothing; the current value is just the latest point on a timeline the store keeps for every key. That is the same machinery Snowflake's Time Travel runs on, and naming it is half the round.
- 1 diagram
- 5 sections
- about 40 min
Premium lessonSnowflake interview guide
These took digging.
What candidates walked out with, from 20,000+ reports, forum threads behind logins and write-ups in Chinese. Then solved step by step.
100 companies. Checked every month.
Unlock all 100 companies$49 a year · less than $1 a week · 30-day money-back guarantee
Snowflake interview guideKnow what Snowflake asks before you walk in.
10 coding · 5 system design · 18 behavioral questions
Get their questions first.
InterviewLegend is independent and not affiliated with or endorsed by any company it covers.