Command Palette

Search for a command to run...

PHASE 0Beginner ~7 min· topic 4 of 6

Topic 0.4

Trade-offs

In one line

The most senior signal in an interview is the ability to answer 'why this and not that?' Every architectural decision is a trade-off; interviews test whether you can name the thing you gave up.

0/6 · 0%

Think of it like this

Choosing between a bike and a car to get to work. The bike is cheap and beats traffic but gets you wet in the rain; the car is comfortable but costs more and gets stuck in jams. No option is 'best'; it depends on what you need today.

Key ideas

  1. 01

    SQL vs NoSQL: SQL = joins, transactions, strong consistency; NoSQL = horizontal write scaling, flexible schema, eventual consistency.

  2. 02

    Why Redis: in-memory reads at ~0.1ms vs ~1–5ms for a DB hit; the price is memory cost and cache invalidation.

  3. 03

    Why Kafka: durable, replayable, high-throughput event log; the price is ordering complexity and exactly-once difficulty.

  4. 04

    Why asynchronous: decouples producers/consumers, absorbs bursts, enables retries; the price is eventual consistency and harder debugging.

  5. 05

    Why eventual consistency: low latency and high availability during partitions; the price is stale reads.

  6. 06

    Why microservices: independent scaling, team autonomy, isolated blast radius; the price is distributed-systems complexity.

  7. 07

    Why monolith: simplest possible start, low latency, no network failures; the price is coupling and scaling at the unit of the whole app.

  8. 08

    Every 'why' must end with a measured cost, not a slogan.

Java / Spring map

  • →

    Spring Boot gives you the monolith trivially; adding Kafka + Redis + multiple services is a conscious complexity purchase.

Explain without notes

01

Defend why you would still choose a monolith for a 20-person startup.

02

Name two real costs of choosing microservices (not abstractions — concrete incidents).

Practice

01

For each 'Why X?' question in this topic, write a one-paragraph answer with a concrete number or failure mode.

Trade-offs

  • ↔

    The classic interview trap: 'which database would you use?' — the correct answer is 'it depends on the access pattern and consistency budget'.

Run it in production

Completion checklist

  • I can answer all seven 'Why X?' questions with a real trade-off each.

Back to phase