Skip to content
Tech Interview Prep
Technical interview guide

Scalability Fundamentals

Production scalability fundamentals for technical interviews: bottlenecks, scaling, load balancing, autoscaling, capacity, overload control, and failure behavior.

Minutes to read
4
Practice MCQs
25
Interview Q&A
25
Edition
v8
Editorial status
Reviewed

Scope: Vendor-neutral fundamentals; Google SRE, AWS Well-Architected, Google Cloud, and IETF references accessed 2026-08-30..

Overview

Curated: · Written: · Reviewed:

Scalability Fundamentals

In one line

Scalability means meeting a changing workload at a stated latency, error and freshness target. Measure the bottleneck first, then scale or remove the constraint that is actually limiting, and define overload behaviour before traffic arrives.

Key definitions

  • Offered load and goodput: what arrives per second, and what completes within its objective. Report both.
  • Bottleneck: the first resource to saturate under load. It moves after each fix, so retest.
  • Stateless: any eligible instance can serve the next request. The state lives in a cookie, database, cache or durable store.
  • Backpressure: a full queue or slow consumer pushes waiting or refusal upstream instead of growing memory.
  • Admission control: rejecting work at the edge when it cannot finish inside its deadline.
  • Retry budget: a cap on retries as a share of recent requests, so retries cannot multiply an outage.

Formulas and complexity

T(N)=sT1+(1−s)T1NT(N)=sT_1+\frac{(1-s)T_1}{N}

Amdahl: with serial fraction s, the speedup ceiling is 1/s, and it is never reached in practice.

concurrency=arrival rate×service time\text{concurrency}=\text{arrival rate}\times\text{service time}

Adding pool connections does not add work. At 3,000 req/s and 15 ms per query, 45 queries are in flight.

Cpool=connectionsmean query timeC_{pool}=\frac{\text{connections}}{\text{mean query time}} Aseries=∏iAionly if all components are mandatory and their outages are independentA_{\text{series}}=\prod_i A_i \quad\text{only if all components are mandatory and their outages are independent}
  • Numbers to quote: 1/8 of follow-up requests hit the owning instance under round robin with 8 instances (7 of 8 miss). A 10% retry budget on 2,000 rps over 10 s allows 2,000 retries. Overlapping outages: 432 + 432 + 432 minutes with a 400-minute shared overlap gives 896 minutes, or 97.93% in a 43,200-minute window, not 0.99^3.

How it works

  • Clients hit a load balancer that spreads work. It adds no backend capacity and assumes roughly equal work per request.
  • Stateless API instances share a connection pool. Pool size, not instance count, often sets the ceiling.
  • Autoscaling is delayed feedback: signal, decide, boot, warm. Headroom and admission control cover that gap.
  • Liveness checks only the process. Readiness checks what the instance needs to serve. A shared-dependency failure must not remove the whole fleet.
Clients Load balancer Stateless API instances Connection pool Primary database Cache Admission control and deadlines

When to use and when not to

ChoiceUse whenAvoid when
Vertical scalingQuick relief; state is hard to partitionNode ceiling is near; no failure domain left
Horizontal scalingWork partitions; shared dependencies have headroomThe shared writer or pool is the limit
Sticky sessionsLocal state is costly to externalizeFailover must be seamless; hot keys
Scheduled scalingPredictable peaksUnpredictable spikes
Reactive autoscalingGradual, measurable demandRamps faster than boot and warm-up time
Load sheddingOffered load exceeds useful capacityYou can still add capacity cheaply

Traps interviewers probe

  1. Adding application nodes when a shared pool or primary is saturated. Fix: read per-tier utilization and wait time, scale the saturated tier, and count connections against the database limit.
  2. Session or cart state held in process memory. Fix: move it to a shared store, or use sticky routing and state the failover loss in advance.
  3. Health checks that call a shared dependency. Fix: liveness checks the process only. A 2 s interval with an unhealthy threshold of 3 removes every instance within about 4 s when the database fails.
  4. Multiplying availability when components share failures or are not all mandatory. Fix: take the union of downtime and recompute.
  5. Unbounded queues and unlimited retries. Fix: bounded queues, end-to-end deadlines, a retry budget, and 503 with Retry-After when overloaded.

Interview tips

Open with the workload and SLO, then the mandatory dependency path, then the bottleneck you measured. Do not start with the component you would scale.

Expected follow-ups:

  • What did you measure, and what would falsify the design?
  • The database saturates after you add nodes. What now?
  • How does autoscaling handle a 10x spike?
  • What happens when a zone is lost at peak?
  • What is the retry policy, and where do retries happen?

30-second outline: The SLO is p99 200 ms at 1,000 rps. The per-tier data shows the connection pool saturated while application CPU is low. I would raise pool capacity and check connection hold time, not add nodes, because more nodes add waiters to the same pool. I would keep offered load and goodput separate, bound the queue, set deadlines, and cap retries with a budget. I would confirm the fix with a repeated step load test that watches pool wait, database CPU and goodput.

Feedback on this overview

Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.