Scalability is a system’s ability to handle increased demand by adjusting resources. In a frontend system-design interview, a working interface is not the whole answer: be ready to explain how it performs as traffic grows and how it interacts with backend services. section 6.3 section 1.1
Interview question: scale a growing application
Suppose traffic rises beyond what one server can handle. Adding CPU or memory to that server is vertical scaling: relatively simple to manage, but limited by the machine and vulnerable to a single point of failure. Adding instances is horizontal scaling: it offers elasticity and fault tolerance, but requires load balancing and attention to state management. A strong answer chooses between them using performance, reliability, and business constraints rather than assuming that more servers are always better. section 6.3
Follow-up questions often test how the choice works in practice:
- How will traffic reach the added instances? Explain the load balancer’s role in distributing requests. section 6.3
- When should capacity change? Discuss autoscaling policies based on load metrics, including CPU or request rate. section 6.3
- Can repeated requests be served without repeatedly reaching the database? Caching across client, CDN, application, and database layers can reduce load and latency, but adds consistency, invalidation, and observability work. section 6.4
Listing 6.5 HPA manifest for multi-metric autoscaling in Kubernetes
apiVersion: autoscaling/v2 #A
kind: HorizontalPodAutoscaler #B
metadata:
name: my-api-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: my-api
minReplicas: 3 #C
maxReplicas: 20 #D
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 70 #E
- type: Pods
pods:
metric:
name: http_requests_per_second
target:
type: AverageValue
averageValue: 100 #F
The Kubernetes autoscaling manifest makes a scaling policy concrete: it bounds replicas from 3 to 20 and specifies CPU utilization and HTTP requests per second as metrics. section 6.3
In an interview, state the expected load, justify the scaling strategy, and name its operational costs. Connect frontend performance to backend capacity rather than treating the interface as an isolated system. section 6.3 section 1.1




































