Don’t start drawing boxes. Clarify what’s needed, estimate size, sketch a simple design, then improve the bottlenecks, talking about trade-offs the whole time.
Deep dive: code generation (base62 counter vs hash vs random with collision check), caching hot links in Redis, 301 vs 302 for analytics, sharding by code.
Bottlenecks and trade-offs: what fails first and how I’d monitor it.”
Traps that make people fail
Jumping into microservices and Kafka for a problem that needs one database.
Rough maths to understand the size of the problem: requests per second, storage per year, bandwidth. It guides design decisions.
Say it like this in the interview
“Daily active users times actions per day divided by 86,400 seconds gives QPS; multiply by 2–3 for peaks; storage equals items per day times size times retention. Round numbers aggressively and state assumptions.”
Cache = keep a copy closer to whoever needs it. You can cache in the browser, CDN, app memory, Redis, or the database’s own buffer. The hard part is knowing when the copy is outdated.
Say it like this in the interview
“Browser and CDN for static and public content, application or distributed cache like Redis for computed data and sessions, and database caches. Patterns: cache-aside, write-through. The hard parts are invalidation, choosing TTLs, and the thundering herd problem when a hot key expires, solved with request coalescing, early refresh or jittered TTLs.”
When work doesn’t need to happen while the user waits (emails, video processing, reports), or to absorb traffic spikes: put jobs in a line and let workers process them at their own pace.
Say it like this in the interview
“To decouple producers and consumers, smooth spikes, retry failed work and run slow tasks asynchronously. Trade-offs: eventual consistency, ordering, at-least-once delivery requiring idempotent consumers, dead-letter queues, and more infrastructure to monitor.”
Microservices let teams deploy independently, but add network calls, distributed data and lots of operational work. Most products should start as a well-structured monolith.
Say it like this in the interview
“Start with a modular monolith; extract services when there are clear boundaries, independent scaling needs, or teams blocking each other. Microservices bring distributed transactions, observability and deployment complexity, so the benefit must be organisational or scaling.”
Monitoring tells you something is wrong. Observability lets you figure out why, by exploring logs, metrics and traces.
Say it like this in the interview
“Metrics for trends and alerting, structured logs for events, and distributed traces to follow a request across services, correlated by trace ID, often via OpenTelemetry. It lets you answer new questions without shipping new code.”
Try the cheap fixes first and the complicated ones last.
Say it like this in the interview
“First, query optimisation and indexes, which often solves it. Then caching hot reads, connection pooling, and vertical scaling. Then read replicas for read-heavy load, accepting replication lag. Then moving workloads elsewhere: search to Elasticsearch, analytics to a warehouse, queues for writes. Sharding or partitioning last, because it complicates queries, transactions and operations.”
When the network between your servers breaks (a partition), you must choose: refuse some requests to stay correct (consistency), or keep answering even if some answers are stale (availability).
Say it like this in the interview
“During a network partition, a distributed system chooses between consistency and availability. Bank balances favour consistency; a social feed or product catalogue can favour availability with eventual consistency. PACELC adds that even without partitions there’s a latency vs consistency trade-off.”
A way of spreading keys across servers so adding or removing a server only moves a small portion of keys instead of reshuffling everything.
Say it like this in the interview
“Servers and keys are placed on a hash ring; each key goes to the next server clockwise. Adding a node moves only about 1/n of the keys. Virtual nodes even out distribution. Used in distributed caches and databases.”
Review the important things first (does it work, is it safe, can it be maintained), and comment on the code, not the person.
Say it like this in the interview
“Correctness and edge cases first, then security, then design and readability, then tests, and style last, ideally automated by linters. I ask questions instead of giving orders (‘what happens if this list is empty?’), separate blocking issues from nitpicks, praise good solutions, and keep PRs small so reviews stay fast. With AI-generated code, I’m extra careful about plausible-looking code that doesn’t handle edge cases.”
Managers don’t buy “the code is ugly”. They buy “this costs us X days per feature and caused Y incidents”.
Say it like this in the interview
“I translate debt into business impact: lead time, incident counts, onboarding time, developer hours lost. I propose incremental work tied to features we’re building anyway, for example the boy-scout rule plus a fixed percentage of each sprint, rather than a big rewrite, and I measure improvement afterwards.”
Stop the bleeding first, find the root cause later. Communicate the whole time.
Say it like this in the interview
“Acknowledge and assemble the right people, assign roles (incident lead, communications). Mitigate first: roll back the latest deploy, disable a feature flag, scale up, fail over. Keep stakeholders updated at regular intervals. Once stable, investigate with logs, metrics and traces. Afterwards, a blameless post-mortem with timeline, root cause, and action items like alerts, tests or runbooks so it can’t repeat.”
Explain the problem, the options you considered and why you chose one, so others can review before code is written.
Say it like this in the interview
“Context and goals, non-goals, proposed design with diagrams, alternatives considered with trade-offs, data model and APIs, rollout and migration plan, risks, monitoring and open questions. Shared early for review.”
Users need messages delivered instantly, stored safely, and shown in order, even when they reconnect.
Say it like this in the interview
“WebSocket gateway servers for persistent connections, with a pub/sub layer like Redis to route messages between gateway instances; messages persisted to a database partitioned by conversation; message IDs for ordering and deduplication; offline delivery via push notifications; presence with heartbeats; and history fetched with cursor pagination.”
Count how many requests each user makes in a time window and reject extras, consistently across many servers.
Say it like this in the interview
“Token bucket or sliding window counters in Redis with atomic Lua scripts or INCR plus EXPIRE, keyed per user, API key or IP; return 429 with Retry-After; enforced at the gateway; with a fail-open versus fail-closed decision when Redis is down.”
Many parts of the app want to notify users. Centralise it: one service accepts requests, respects user preferences, and delivers via queues with retries.
Say it like this in the interview
“A notification API enqueues events; workers per channel apply user preferences, templates and rate limits, call providers with retries and backoff, record delivery status, and deduplicate with idempotency keys. Dead-letter queues handle failures.”