Practice
Every quick-check question from Foundations and the case studies, in one place. Click a question to open the article it's from and take it there, this page is just the index.
Foundations
Core Concepts
Availability
A service runs three replicas behind a load balancer, all in the same availability zone. The team calls this highly available. What's the actual flaw in that reasoning?CAP Theorem
Amazon's shopping cart stays available and lets you add items even during a network partition between data centers, but the actual payment charge at checkout gets rejected rather than risk double-charging. What does this tell you about CP vs AP?Latency vs Throughput
Under load testing, a single request takes 50ms whether tested alone or as one of 10,000 concurrent requests. In production, p99 latency balloons under real traffic while individual request processing time stays exactly the same. What's the most likely explanation?Scalability
A team doubles their app server count to handle 2x traffic, but throughput barely moves. What's the most likely reason horizontal scaling didn't help here?
Storage & Data
Caching
A team adds a Redis cache in front of their product-price database to speed up reads. Reads get faster immediately. Three weeks later, a price correction doesn't show up on the site for six hours. What's the most likely cause?Database Indexes
After adding indexes on five columns to speed up five different dashboard queries, a team notices that inserting a new row now takes noticeably longer than before, even though none of the five dashboard queries touch the insert path. Why?Database Replication
A primary database acknowledges a write to the client, then crashes one second later, before that write has streamed to any replica. The system fails over to a replica automatically. What happened to that write?Database Sharding
A team shards their orders table by restaurant_id to spread write load evenly. A single national fast-food chain then onboards, and nearly a third of all new orders route to that one chain's shard. What actually went wrong?Databases (SQL vs NoSQL)
A team picks a NoSQL document store for their new order-management system because 'it's more scalable,' then six months later needs a monthly report joining orders, customers, and refunds across the whole dataset, and finds it painful. What was the actual mistake?
Networking & Delivery
API Gateway
After introducing an API gateway to centralize auth, one team ships a change to their service's business logic and it breaks in production. Another team's unrelated bug fix to the gateway's rate limiter, deployed the same week, also breaks something, but for every service at once. What does the difference between these two incidents actually tell you?CDN
A team profiles their origin server and finds it responds in under 10ms for every request, yet users in another region still report page loads that feel slow. The team spends a sprint optimizing server-side code further with no improvement. What did they miss?Load Balancers
A team switches from round robin to least-connections hoping to fix uneven load, then notices a newly deployed tenth instance gets slammed with traffic the moment it joins the pool, more than its fair share. What's the most likely explanation?Message Queues
A consumer successfully sends a welcome email, but crashes before it can acknowledge the message back to the queue. What happens next, and what does that mean for how the consumer needs to be written?Rate Limiting
A team switches from a fixed window to a token bucket sized at 100 tokens, refilling at 100 tokens per minute, hoping to eliminate the boundary burst problem. A client that's been completely idle for an hour can still send 100 requests in a single burst the instant it starts. Is this a bug in the token bucket?
Architecture Patterns
Circuit Breaker
A circuit breaker trips open on a failing payment processor. After the cooldown, it enters half-open and lets exactly one test call through, which succeeds, and immediately closes the circuit, sending full traffic back to the processor. The processor immediately falls over again. What's the most likely problem with this design?CQRS
A team hears about CQRS and assumes it requires standing up a separate database technology, like adding Elasticsearch or MongoDB alongside their existing Postgres. Is that requirement accurate?Event-Driven Architecture
An 'order placed' event gets published and three services subscribe: shipping, billing, and loyalty. Loyalty's consumer has a bug and silently fails to process every event for two weeks. What's the most likely way this actually gets discovered?Microservices Architecture
A team splits their monolith into an orders service and an inventory service, each with its own database. A feature needs to atomically decrement inventory and create an order, guaranteed both happen or neither does. What changed about implementing this?Monolith vs Microservices
A company splits its monolith into a 'users' service and an 'orders' service, drawn along a technical layer, not along their two actual teams, which are organized by customer segment, enterprise and self-serve, each team needing to touch both users and orders constantly. What's the most likely outcome?
Security
Authentication vs Authorization
A user's session correctly identifies them and their role at login. A week later, an admin revokes that user's access to a specific project, but doesn't log them out. The user, still logged in with the same valid session, requests that project's data. What should happen, and why?Encryption & TLS
A company enforces TLS on every API endpoint and every internal service call. Their database backups are stored in cloud storage with default settings, unencrypted, readable by anyone with access to that storage bucket. Is this company's data encrypted?JWT & Sessions
A team using JWTs with a 24-hour expiration wants to support 'log out on all devices' as an instant action. They implement it by deleting the user's session data client-side on every device the user is currently logged into. Does this actually revoke the JWTs those devices are still holding?OAuth 2.0 & OpenID Connect
An app integrates 'Sign in with Google' purely by checking that it successfully received an OAuth access token after the redirect flow completed, without requesting or verifying an ID token. What's the actual risk in this implementation?Password Hashing
Two users at the same company happen to pick the exact same password. In a system using bcrypt with per-password salting, what do their two stored password hashes look like?
Reliability
Idempotency Keys
A client retries a POST request with the same idempotency key after a timeout. What actually makes this retry safe?Outbox Pattern
A relay process reads an outbox row, successfully publishes it to the broker, then crashes before it can mark the row as published. What happens to that event?
Observability & SRE
Alerting & On-Call
A team is debating whether to add a new page for 'memory usage above 80%.' The service autoscales, and memory routinely crosses 80% briefly during normal traffic spikes before scaling out and recovering on its own. Should this fire a page?Chaos Engineering
A team has a circuit breaker in front of their fraud-detection service, a health check meant to pull a struggling instance out of rotation, and a page configured to fire the moment the breaker trips. During a real outage, fraud-detection goes fully unresponsive for twenty minutes, checkout goes down with it, and nobody gets paged until a customer complaint arrives. The postmortem finds the breaker's threshold was measured against total checkout traffic instead of fraud-detection traffic specifically, a bug that made the threshold effectively unreachable. What does a chaos experiment, run before this outage, actually add that a code review of the threshold wouldn't?Disaster Recovery
A team backs up their order database nightly at 2am and has successfully verified the backup file itself is valid and uncorrupted every single night for the past year. During an actual regional outage, they discover restoring service takes nine hours instead of the one hour they'd always assumed. What did their testing process actually fail to verify?Distributed Tracing
A team looks at a trace for a slow checkout request and sees it end after the pricing service, two spans total, even though they know the request definitely reached the payment service afterward, since the order was successfully charged. What most likely happened?Health Checks & Readiness Probes
A service's single /health endpoint returns 200 as soon as the process starts, even though it takes another 25 seconds to finish loading a product catalog into memory. During a routine scale-out event, new instances join the load balancer's pool and immediately start failing a chunk of requests with 'product not found' for their first 25 seconds alive. What's the actual fix?Metrics, Logs & Traces
A checkout request passes through six services. A dashboard shows p99 latency spiked 15 minutes ago. The team greps the payment service's logs around that time and finds a timeout error there. They conclude payment service is the bottleneck and start investigating its database queries. What's the actual risk in this conclusion, without having looked at a trace?SLIs, SLOs & Error Budgets
A team is comfortably beating their 99.9% uptime SLO, running at 99.98% for the past two quarters. An engineer proposes spending the next quarter on infrastructure work to push toward 99.99%. What's the first question worth asking before approving that work?
Case Studies
Web-scale
Design a URL Shortener
Why does a base62-encoded auto-increment counter avoid collisions entirely?
Java & Spring
Coming soon.
Payments
Design a Payment Gateway with Idempotent Retries
A merchant's request to charge a card times out after 5 seconds with no response. The charge may have already succeeded on the processor's side. What should the merchant's retry do?