Project library
Course & capstoneAmazon · Software Development Engineer · 2022

A tiny key-value store with write-ahead logging for my databases course

Shared by J. Okafor · ex-Amazon SWE New Grad

The sharer told this exact project in their Amazon new-grad loop and went on to receive the offer.

Step into this interview

4 real follow-ups from the actual loop · 1 hard · ~12 min

You answer each question first — only then does the sharer's real take open up.

How they told it

I built a single-node key-value store for a systems course and it turned into a 30-minute conversation about durability tradeoffs — because I was honest about where it broke.

Read the full telling

This was the final project for my undergrad databases course. The assignment was to build a persistent key-value store in Java, and the grading rubric cared about crash recovery. I did the write-ahead log part myself; two teammates handled the B-tree index and the CLI. My piece was: append each put/delete to a log file before touching the in-memory map, then replay the log on startup. I got fsync working so a kill -9 mid-write wouldn't lose committed data. Where it fell apart: the log grew forever because I never wrote compaction or checkpointing, so restart time got slow with a big log. We had maybe two weeks, so I cut checkpointing and just documented it as a known limitation in the README. It was never used by anyone real, it was graded and that's it. In the interview I led with that framing, said 'this was a class project, here's the part I owned,' then walked the durability path. The interviewer kept pushing on what happens if the machine dies during fsync itself, and I had to reason about torn writes on the spot rather than pretend I'd handled it.

What they actually got asked

Walk me through exactly what happens on a put, from the call to the data being durable.

medium

What happens if the process crashes halfway through writing a log record?

hard

Which part was yours versus your teammates'?

easy

Knowing what you know now, what would you change first?

medium