fivenines

Practice / target 80%

Single-Node Key-Value Core Practice

01

A client sends `SET name Ada`, then another client sends `GET name`. Which piece of server state makes the second command see the first command's effect?

intro

Scenario

Two different connections interact with the same key moments apart on one server.

02

A beginner stores raw byte arrays directly in the keyspace. What becomes harder to add later: multiple value types or clean command-specific behavior? Explain the dependency.

intro

Scenario

A from-scratch implementation stores whatever bytes arrive directly into its dictionary with no wrapper around them.

03

Predict the reply difference between `GET missing` and `GET empty-string-key`. Why must these be distinct?

applied

Scenario

One key was never created, and another was explicitly set to a zero-length string; a client reads both.

04

A command handler parses socket bytes and writes directly to the socket. Which boundaries from the lesson has it crossed?

applied

Scenario

Code review finds a command handler that reads bytes off the socket itself and writes its reply straight back to the file descriptor.

05

State the invariant the database should satisfy immediately before a command reply is queued.

advanced

Scenario

You are writing the one-sentence contract that relates keyspace state to the moment a reply is queued.