What is the CAP theorem?
During a partition you can’t be both linearizable and available. Most systems are neither CP nor AP.
OLTP vs OLAP: what is the difference?
Rows by key in milliseconds, or billions of rows by column in seconds.
Sharding vs partitioning: what is the difference?
Split the data, then decide where the pieces live, and what happens when one gets hot.
How does the Raft consensus algorithm work?
Elect a leader with an up-to-date log, replicate to a majority, and mind the current-term rule.
How does Paxos reach consensus?
Promise, then accept: two majority rounds, and a chosen value can never change.
What are message queues and brokers, and when do you use them?
Queue or log, at-least-once, idempotent consumers, and the outbox.
Guess the complexity
Read the code, call the Big-O before the reveal. Six snippets, from O(1) to O(2ⁿ).