Trade-offs

Technology comparisons for interviews

Kafka vs RabbitMQ, Redis vs Memcached, REST vs GraphQL, and more — with expected answers.

Difficulty Medium→Hard Read ~25 min Master 1–2 weeks Levels Mid–Staff

Interviewers love comparisons because they force trade-offs, not memorized definitions. For each pair: say when to use A, when to use B, and when neither.

Kafka vs RabbitMQ

Difficulty Hard Read ~8 min Master 3–5 days Levels Senior
Interview cheat comparison
DimensionKafkaRabbitMQ
ModelDurable partitioned logSmart broker queues / exchanges
OrderingPer partition keyPer queue (with caveats)
ReplayNative via offsets / retentionNot the primary design
RoutingCoarse (topics/keys)Rich exchanges/bindings
ThroughputVery high sequential I/OLower; flexible patterns
Use whenEvent streaming, analytics, replayTask queues, complex routing, RPC-ish

Follow-ups: Exactly-once? Poison messages? Multi-region mirror?

Redis vs Memcached

Difficulty Medium Read ~6 min Master 2–3 days Levels Mid–Senior
DimensionRedisMemcached
Data structuresRich (strings, ZSET, hashes, streams)Simple key/value blobs
PersistenceOptional AOF/RDBEphemeral
ClusteringRedis ClusterClient-side sharding historically
Use whenCounters, leaderboards, locks, queues, cacheSimple hot-blob cache at huge QPS

REST vs GraphQL

Difficulty Medium Read ~7 min Master 2–4 days Levels Mid–Senior
DimensionRESTGraphQL
ContractResources + verbsSchema + queries/mutations
Over/under fetchCommon without BFFClient specifies fields
CachingHTTP cache-friendlyHarder at edge; need persisted queries
ComplexityMany endpointsResolver/N+1 risks
Use whenPublic APIs, simple CRUD, cacheable GETsBFF for varied clients, graph-shaped data

SQL vs NoSQL (interview framing)

Difficulty Medium Read ~6 min Master 3–5 days Levels Mid–Senior

See also the book chapter SQL vs NoSQL. In interviews, lead with access patterns, transactions, and query flexibility — not hype.

Strong consistency vs availability (CAP lite)

Ticket booking and payments need strong inventory/ledger correctness. Feeds and likes often choose availability + eventual consistency. Say the product consequence out loud — that is the interview.