Interview Study Guide

System Design & AI Engineering: Interview Study Guide

Created · Updated

How to use this guide#

One reference for any system design or AI engineering round, from intern to staff (L3–L6 / SDE1–SDE3). Every topic is split into three layers: Fundamentals (learn once, revise before interviews), Most asked questions (the questions that come up again and again, with a model answer), and Senior-level questions (edge cases and production experience that separate senior from mid-level). Most pages end with a quiz where every question has an answer you can open.

What each level is judged on:

LevelWhat the interviewer expects
Intern / SDE1 (L3)Correct building blocks, a working high-level design, basic SQL vs NoSQL reasoning
SDE2 (L4)Sensible scaling, caching, data model, API, and one or two deep dives done well
SDE3 / Senior (L5)You drive the interview, quantify with estimates, name trade-offs before being asked, cover failure modes
Staff (L6+)Multiple valid designs compared, evolution over time, cost, org and operational impact, migration plans

The 45-minute framework (use it every time)#

  1. Clarify requirements (5 min). Functional: the 3–5 core features. Non-functional: scale (DAU, QPS), latency target, consistency vs availability, durability, read/write ratio. Say out loud what is out of scope.
  2. Estimate (3–5 min). QPS, storage, bandwidth, memory for cache. Only as precise as needed to make decisions.
  3. API and data model (5 min). Endpoints or events, key entities, access patterns. Access patterns decide the database.
  4. High-level design (10 min). Client → LB → services → cache → DB → async workers. Walk one request end to end.
  5. Deep dives (15 min). Pick the 2–3 hardest parts: the hot path, the consistency-critical write, the scaling bottleneck.
  6. Failure modes and wrap-up (5 min). What breaks, how you detect it, how you recover. What you would do next with more time.

Golden rule: every component you draw needs a reason. If you add Kafka, say why a queue and not a direct call. If you add Redis, say what is cached, the TTL, and what happens on a miss.

About the numbers: figures in this guide (throughput per node, latencies, cost ratios) are rules of thumb for interview estimation, written from general knowledge and not benchmarked. Quote them as approximations and check vendor docs before relying on one in real work.

How each page is organised#

  1. Fundamentals: what it is, how it works, the trade-offs, configuration and when to use which option.
  2. Most asked questions: the questions interviewers ask most, each with a short model answer.
  3. Senior-level questions: the “what goes wrong in production” probes.
  4. Quiz: short questions with answers hidden behind a click, so you can test yourself.

Pages tagged Most asked and Senior in the sidebar are the question banks that span many topics (full design walkthroughs and production edge cases).

All pages#

Use the sidebar on any page, or start from the list below. Read the first six pages in order if you are new to system design.

System design

1.1 Back-of-envelope estimationThe handful of numbers and the four-step method that turn 'DAU' into QPS, storage, bandwidth and cache size, with worked examples and the follow-ups interviewers ask.6 min read · updated Nov 29 1.2 Networking and protocolsTCP vs UDP, HTTP/1.1 to HTTP/3, DNS, TLS and the real-time options (polling, SSE, WebSockets, WebRTC): what each one costs, when to pick it, and how to say it in an interview.16 min read · updated Nov 29 1.3 REST API designResources, methods, status codes, error format, validation, idempotency, pagination, versioning and conditional requests, with the exact answers interviewers look for.20 min read · updated Nov 29 1.4 Load balancingWhat a load balancer actually does, when to introduce one, L4 vs L7, every common algorithm and configuration knob, health checks, sticky sessions, HA, global balancing and what real production setups look like.20 min read · updated Nov 29 1.5 Scaling patternsHow to scale a system step by step: find the bottleneck, make services stateless, autoscale, scale reads and writes differently, scale the database in the right order, and handle spikes.15 min read · updated Nov 29 1.6 Rate limiting and load sheddingWhat rate limiting is, why every API needs it, the five algorithms with code, where to enforce it, the 429 contract, how clients must react, and how to build it distributed.17 min read · updated Nov 29 2. CachingCaching from the browser to the database: where caches live, read/write strategies, keys and TTLs, invalidation and its races, stampede/penetration/avalanche/hot-key fixes, eviction, Redis, consistency and measurement.19 min read · updated Nov 29 3. Databases — types and how to choose6 min read · updated Nov 29 4. Databases at scale — indexing, big queries, transactions9 min read · updated Nov 29 5. Replication, sharding, CAP and consistency10 min read · updated Nov 29 6. Messaging and async processing10 min read · updated Nov 29 7. Idempotency — order placed once, charged once7 min read · updated Nov 29 8. Distributed systems theory4 min read · updated Nov 29 Concurrency and connection pool basicsThreads vs async, locks and deadlocks, race conditions, thread and connection pool sizing, and how single-machine concurrency ideas map to distributed systems.5 min read · updated Nov 29 9. Failure and recovery — "what happens when X breaks?"8 min read · updated Nov 29 Microservice patternsAPI gateway vs BFF, service discovery, sagas (orchestration vs choreography), CQRS and event sourcing, the strangler migration and service mesh, with when each is worth its cost.6 min read · updated Nov 29 Data processing: batch, streaming, CDC and analytics storageBatch vs stream processing, Lambda and Kappa, windows and late data, CDC pipelines, warehouses vs lakes, columnar and time-series stores, and object storage design.6 min read · updated Nov 29 10. Real-time, observability, deployment, security, LLD6 min read · updated Nov 29 Authentication, authorization and API securitySessions vs tokens, OAuth 2.0 and OIDC flows, JWT pitfalls, RBAC vs ABAC, secrets and encryption, and the OWASP risks every API designer should be able to name and fix.6 min read · updated Nov 29 SRE and operations: SLOs, capacity, incidents and costSLIs, SLOs and error budgets, burn-rate alerting, capacity planning, incident response and postmortems, on-call health and cost engineering: the senior and staff-level operations topics.5 min read · updated Nov 29 11. Top asked system design questions16 min read · updated Nov 29 · Most asked Design: URL shortenerA complete 45-minute answer for a TinyURL/bit.ly style service: requirements, estimates, ID generation, redirect path, caching, analytics, abuse handling and follow-ups.5 min read · updated Nov 29 · Most asked Design: notification systemPush, SMS, email and in-app notifications at scale: ingestion, templating, preferences, per-channel workers, provider failover, deduplication, rate limits, priorities and delivery tracking.5 min read · updated Nov 29 · Most asked Design: payment systemA payment flow that never double-charges or loses money: payment states, idempotency, double-entry ledger, gateway integration, webhooks, reconciliation, refunds and PCI scope.5 min read · updated Nov 29 · Most asked Design: ticket booking (BookMyShow)Seat selection with temporary holds, never double-booking, the hot-show contention problem, virtual waiting rooms, payment timeouts and releasing expired holds.5 min read · updated Nov 29 · Most asked Design: ride-hailing (Uber/Ola)Driver location ingestion, geospatial indexing (geohash, H3), matching one driver to one rider, trip state machine, ETA and surge pricing, and real-time updates.5 min read · updated Nov 29 · Most asked Design: typeahead, crawler, video streaming, job scheduler, metricsFive more frequently asked designs in condensed form: autocomplete, web crawler, video streaming pipeline, distributed job scheduler and a metrics/logging platform.6 min read · updated Nov 29 · Most asked 12. Senior-level questions — edge cases and lessons from production5 min read · updated Nov 29 · Senior 13. Trade-offs and follow-up patterns3 min read · updated Nov 29 · Senior

AI engineering

14. LLM fundamentals4 min read · updated Nov 29 Transformer internals, KV cache and quantizationAttention, why the KV cache dominates memory, the memory math for weights and cache, GQA, FlashAttention, quantization (INT8/INT4, GPTQ, AWQ) and context length trade-offs.7 min read · updated Nov 29 15. Prompting, structured output, context engineering2 min read · updated Nov 29 16. Embeddings, ANN indexes and vector databases10 min read · updated Nov 29 17. Designing an efficient RAG pipeline5 min read · updated Nov 29 18. Graph databases and GraphRAG3 min read · updated Nov 29 19. Agents, tool use, MCP, memory, multi-agent4 min read · updated Nov 29 Agent frameworks, protocols, computer use and sandboxingAgent loops as state machines, durable execution, framework trade-offs (LangGraph-style graphs, workflow engines), MCP vs agent-to-agent protocols, computer-use agents and sandboxing untrusted code.6 min read · updated Nov 29 20. Evaluation, guardrails and AI security4 min read · updated Nov 29 Evaluation in practice: tooling, online evals and A/B testingA concrete evaluation workflow: datasets, metrics, RAGAS-style RAG metrics, promptfoo-style CI evals, tracing tools, online evaluation, A/B tests and how to calibrate LLM judges.6 min read · updated Nov 29 AI safety, privacy and compliance engineeringPII handling in LLM pipelines, data residency, audit logging, access control for retrieval, retention and deletion, regulated-domain controls and a practical review checklist.6 min read · updated Nov 29 21. LLMOps — gateways, caching, cost, latency, serving, fine-tuning4 min read · updated Nov 29 Model adaptation: prompting, RAG, fine-tuning, LoRA, RLHF and distillationA decision tree for adapting an LLM to your task, how supervised fine-tuning, LoRA/QLoRA, preference tuning (RLHF, DPO) and distillation work, data requirements, and how to evaluate the result.6 min read · updated Nov 29 LLM cost and capacity mathHow to price an LLM feature: tokens per request, input/output price asymmetry, caching and batch discounts, a worked monthly bill, routing and cascading, and build vs buy break-even.6 min read · updated Nov 29 LLM serving: batching, speculative decoding, GPUs and capacityHow inference servers (vLLM, TGI, TensorRT-LLM) reach high throughput: continuous batching, PagedAttention, prefix caching, speculative decoding, parallelism, GPU sizing and autoscaling.6 min read · updated Nov 29 22. Top AI system design questions10 min read · updated Nov 29 · Most asked AI design walkthroughs: code assistant, AI search, document processingThree complete AI system designs: an IDE code assistant, a Perplexity-style answer engine with citations, and an intelligent document-processing pipeline with human review.8 min read · updated Nov 29 · Most asked AI design walkthroughs: recommendations, multimodal pipeline, conversational memoryThree more AI designs: a recommendation system (retrieval, ranking, cold start), a multimodal image/audio/video pipeline and long-term memory for conversational assistants.8 min read · updated Nov 29 · Most asked 23. Senior AI questions, traps and AI-native engineering5 min read · updated Nov 29 · Senior

Your stories

Low-level design

Behavioral

Revision kit

Pritam Ghosh · System design & AI engineering study notes