← Google Interview Insights

Google·Software Engineer·Onsite - System Design / Architecture·Senior

SeniorPrefer not to say
May 2026

Summary

Google system design round focused entirely on building an L4 load balancer from scratch. Pretty deep dive, covered everything from data structures to failover. Left feeling okay about it but not great.

Questions Asked (5)

Q1

Design an L4 (transport layer) load balancer that handles around 1k QPS at normal load and up to 5k QPS at peak, where each backend server can handle roughly 10 QPS.

System DesignAlgorithms & Data StructuresTechnical Trade-offs
Author's notes

The QPS numbers are what made this feel real.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and constraints, then estimate the number of backend servers needed (100-500) and discuss load balancing algorithms suitable for L4. Design a scalable architecture with health checks, failover, and session persistence, and address trade-offs between different approaches.

Pro tip: Emphasize that L4 load balancers operate at the connection level, so they can't inspect application data; this impacts session persistence and routing decisions. Also, mention that consistent hashing can minimize disruption when scaling.

1. Clarify Requirements and Constraints

Ask about expected latency, protocol (TCP/UDP), session persistence needs, and backend server capabilities. Confirm that each backend handles 10 QPS and calculate the required number of servers: 100 at normal load, 500 at peak.

2. Choose Load Balancing Algorithm

Discuss algorithms like round robin, least connections, and consistent hashing. For L4, consistent hashing is often preferred to maintain session affinity and minimize disruption during scaling.

3. Design Architecture for Scalability and High Availability

Propose a distributed load balancer setup with multiple instances (e.g., active-passive or active-active) to avoid single point of failure. Use health checks to detect failed backends and automatically remove them.

4. Address Session Persistence and Connection Handling

Since L4 can't inspect application data, discuss how to maintain session persistence using source IP hashing or consistent hashing. Also, consider connection draining and idle timeout settings.

5. Discuss Trade-offs and Potential Bottlenecks

Compare L4 vs L7 load balancing, and evaluate trade-offs between different algorithms. Identify potential bottlenecks like load balancer throughput and propose solutions like horizontal scaling.

Key Points to Mention

  • L4 load balancing operates at transport layer (TCP/UDP) and doesn't inspect application payload.
  • Consistent hashing minimizes rebalancing when backend servers are added or removed.
  • Health checks are crucial for high availability; implement both active and passive checks.
  • Session persistence can be achieved via source IP hashing or consistent hashing.
  • Load balancer itself must be highly available and scalable, often using DNS round-robin or anycast.
  • Consider connection draining during deployments to avoid dropping active connections.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

Walk through the different load balancing selection algorithms and their trade-offs, including round-robin, modular hashing, least-connections, and consistent hashing.

Technical Trade-offsAlgorithms & Data StructuresSystem Design
Author's notes

I knew the algorithms but fumbled explaining why consistent hashing is better than modular hashing when servers leave or join.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by framing load balancing as a trade-off between simplicity, distribution quality, and adaptability to changes. Then systematically walk through each algorithm, explaining how it works, its strengths, weaknesses, and ideal use cases. Conclude by discussing how real systems often combine or layer these algorithms based on requirements.

Pro tip: Emphasize that consistent hashing is crucial for distributed caches and stateful services because it minimizes disruption when nodes join or leave, but it introduces complexity and potential hotspots. Mention that Google's Maglev and other systems use variants to handle scale.

1. Define the goal and criteria

Briefly state that load balancing aims to distribute requests efficiently, minimize latency, and handle failures. Introduce criteria: fairness, overhead, adaptability, and statefulness.

2. Explain round-robin

Describe round-robin as cycling through servers sequentially. Highlight simplicity and even distribution for homogeneous servers, but note it ignores server load and can cause issues with heterogeneous or stateful services.

3. Explain modular hashing

Explain that modular hashing maps requests to servers using a hash modulo N. It provides session affinity but suffers from massive redistribution when N changes, making it poor for dynamic scaling.

4. Explain least-connections

Describe least-connections as directing traffic to the server with the fewest active connections. It adapts to server load and is good for long-lived connections, but requires tracking connection counts and can be complex.

5. Explain consistent hashing and trade-offs

Introduce consistent hashing with a ring and virtual nodes. It minimizes redistribution when nodes change, ideal for distributed caches, but adds complexity and may have uneven load without careful virtual node tuning.

Key Points to Mention

  • Round-robin: simple, even distribution, but ignores server load and connection duration.
  • Modular hashing: provides session affinity, but poor scalability due to rehashing on node changes.
  • Least-connections: dynamic, adapts to load, but requires state and may not handle heterogeneous server capacities.
  • Consistent hashing: minimizes disruption on node changes, used in distributed systems like Cassandra and DynamoDB, but can cause hotspots without virtual nodes.
  • Trade-offs: consider overhead, adaptability, statefulness, and use case (e.g., stateless vs. stateful services).
  • Real-world systems often combine algorithms (e.g., least-connections with consistent hashing) or use advanced variants like Maglev.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q3

How would you handle backend health monitoring and dynamic membership changes in your load balancer design?

System DesignTechnical Trade-offs
Author's notes

Heartbeats and service registration.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements such as scale, latency, and consistency needs, then propose a health monitoring system with active and passive checks, and a membership management layer using a distributed coordination service. Discuss trade-offs between consistency and availability, and how to handle failures gracefully.

Pro tip: Emphasize the importance of avoiding false positives in health checks and the need for gradual rollout of membership changes to prevent cascading failures. Mention Google's specific tools like Borg or Chubby to show familiarity.

1. Clarify Requirements

Ask about scale, expected failure rates, latency requirements, and consistency vs. availability trade-offs to tailor the design.

2. Design Health Monitoring

Propose a combination of active health checks (e.g., HTTP/TCP probes) and passive monitoring (e.g., outlier detection based on error rates) with configurable thresholds and backoff.

3. Implement Membership Management

Use a distributed coordination service (e.g., etcd, ZooKeeper, or Google Chubby) to maintain a consistent view of healthy backends and propagate changes to load balancers.

4. Handle Dynamic Changes

Describe how load balancers subscribe to membership updates, gracefully drain connections from removed backends, and add new backends with warm-up periods.

5. Discuss Trade-offs and Failure Modes

Analyze trade-offs between consistency and availability (e.g., CAP theorem), and how to handle network partitions, split-brain, and stale membership data.

Key Points to Mention

  • Active vs. passive health checks and their trade-offs
  • Use of distributed coordination services (e.g., Chubby, etcd) for membership
  • Graceful connection draining and warm-up for new backends
  • Consistency vs. availability trade-offs in membership updates
  • Handling false positives/negatives in health checks
  • Scalability of health monitoring (e.g., hierarchical or gossip-based protocols)

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q4

How would you estimate the capacity requirements, including server count, connection table size, and bandwidth needs?

System DesignProduct Analytics & Metrics
Author's notes

Back-of-envelope stuff.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the system's scope, expected user base, and traffic patterns. Then break down the estimation into server count, connection table size, and bandwidth, using assumptions and simple calculations. Finally, validate with sanity checks and discuss trade-offs.

Pro tip: Always state your assumptions explicitly and round numbers to powers of 10 for ease; interviewers care more about your reasoning than exact figures.

1. Clarify Requirements

Ask questions to understand the system's scale: number of users, requests per second, data size, and growth projections.

2. Estimate Server Count

Calculate based on throughput per server (e.g., QPS) and redundancy needs, considering peak load and failover.

3. Estimate Connection Table Size

Determine the number of concurrent connections and memory per connection to size the connection table.

4. Estimate Bandwidth

Compute data transfer rates by multiplying request/response sizes by request rate, and account for overhead.

5. Validate and Iterate

Sanity-check numbers against known benchmarks, discuss bottlenecks, and adjust assumptions as needed.

Key Points to Mention

  • Back-of-the-envelope calculations with clear assumptions
  • Peak vs. average load and over-provisioning for spikes
  • Redundancy and failover (e.g., N+1, multi-region)
  • Memory footprint per connection and connection lifecycle
  • Bandwidth components: payload, protocol overhead, and replication
  • Scalability and cost trade-offs (vertical vs. horizontal scaling)

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q5

How would you design for high availability and observability in this load balancer?

System DesignTechnical Trade-offs
Author's notes

HA pairs with failover and shared state replication.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the load balancer's role and scale, then structure your answer around redundancy, failover, and observability pillars. Discuss trade-offs between active-active vs active-passive, health checking, and monitoring strategies, tying them to Google's reliability expectations.

Pro tip: Emphasize that observability must be designed in from the start, not bolted on—mention how you'd use SLOs to drive alerting and capacity planning, showing you think like a Google SRE.

1. Clarify Requirements and Scale

Ask about expected traffic volume, latency targets, and failure tolerance to scope the design. This ensures your solution aligns with the specific use case.

2. Design for High Availability

Propose a multi-region, active-active deployment with redundant load balancer instances and automatic failover. Discuss health checks, circuit breakers, and graceful degradation.

3. Implement Observability

Outline metrics (latency, error rates, throughput), logging (structured logs for requests/errors), and tracing (distributed tracing for request flow). Mention tools like Prometheus, Stackdriver, and OpenTelemetry.

4. Define SLOs and Alerting

Explain how you'd set SLOs for availability and latency, and create alerts based on burn rates. This ties observability to actionable reliability goals.

5. Address Trade-offs and Evolution

Discuss trade-offs between consistency and availability, cost of redundancy, and how the design can evolve with scale. Show awareness of CAP theorem and operational complexity.

Key Points to Mention

  • Redundancy and failover strategies (active-active vs active-passive, multi-region)
  • Health checking and automatic traffic rerouting
  • Metrics, logging, and distributed tracing for observability
  • SLOs, SLIs, and error budgets to drive alerting
  • Trade-offs: cost vs reliability, latency vs consistency
  • Google-specific tools: Borg, Envoy, Stackdriver, Monarch

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.