01A client sends 1,000 `INCR` commands without reading replies. What improves, and what new server-side risk appears?introScenarioA batch job fires a thousand increments down one connection without waiting for any replies.AThroughput improves and memory is unaffected, because replies stream to the socket as fast as they are produced.BNothing improves, because the server always waits for each reply to be read before executing the next command.CRound-trip overhead improves, but server-side output buffers can grow if the client does not read replies.DPer-command latency improves, but the batch loses its ordering guarantee across the thousand commands.
02Why does pipelining preserve per-connection reply order without making the commands atomic?introScenarioA developer assumes that pipelining a read-modify-write sequence makes it safe from concurrent clients.APipelined batches are atomic, because the server executes the whole batch before serving any other client — the batch boundary is inferred from the moment replies stop being read.BReplies are queued in the same per-connection execution order, but other clients can still interleave between commands so the batch is not atomic.COrder is preserved by sequence numbers in each RESP reply, which the client library uses to reorder responses.DOrder holds only when commands touch different keys; same-key commands may be reordered for efficiency.
03A single socket read contains three commands and the first half of a fourth. What should the parse-dispatch loop do?appliedScenarioOne read from a pipelining client's socket lands three and a half commands in the input buffer.AWait for the fourth to complete, so all commands from one read execute together as a unit.BExecute the three complete commands, then discard the partial bytes since the client will resend the whole fourth command.CExecute only the first command per loop iteration, spreading the rest across later iterations for fairness.DIt should parse and dispatch the three complete commands, then leave the partial fourth command buffered for later bytes.
04A slow Pub/Sub client exceeds an output-buffer limit. Why is disconnecting it safer than keeping it indefinitely?appliedScenarioA subscriber that stopped reading has accumulated megabytes of undelivered pushed messages.ADisconnecting prevents unbounded memory growth for a client that cannot consume pushed messages.BKeeping it is actually safer, because Pub/Sub buffers drop oldest messages automatically once they fill.CThe server should pause all publishers until the slow subscriber catches up, preserving full delivery.DThe server should spill that client's buffer to disk, so memory is protected without losing the connection.
05Which component should handle partial writes: command handlers, client output buffers, or the database?advancedScenarioYou are assigning responsibility for resuming a reply after the socket accepted only part of it.ACommand handlers should retry their own writes, so transport errors map back to the command that produced the data.BClient output buffers should handle partial writes; command handlers produce replies and the database should not know socket state.CThe database should track unflushed replies per key, so a failed delivery can roll the mutation back.DThe kernel handles it already, since a second write resumes where the first stopped and needs no state in Redis, just as it does for files opened in append mode.