Load Balancing Questions with Answers

22 practice questions on Load Balancing (System Design) with answers and step-by-step solutions. Try 10 samples below, then practise all 22 free in the AptiNest app.

Sample questions

Question 1Easy

Path-based routing like /api to one pool and /images to another requires which balancer?

  1. A hardware firewall
  2. Layer 4 (transport) load balancer
  3. DNS round robin
  4. Layer 7 (application) load balancer

Answer: D. Layer 7 (application) load balancer

Explanation

Only an L7 balancer parses HTTP and can inspect the URL path.

Step-by-step solution

  1. Path-based routing needs to read the URL path of each request.
  2. That means reading HTTP, which is an application-layer job.
  3. A Layer 7 (application) balancer parses HTTP and can match /api and /images.
  4. So the balancer needed is Layer 7 (option D).

Why the other options are wrong

  • A. A hardware firewall filters traffic; it does not route by URL path.
  • B. A Layer 4 balancer routes on IP and port and cannot see the URL path.
  • C. DNS round robin returns addresses and cannot see the URL path.

Tip: If the rule depends on the URL, host or headers, you need Layer 7.

Question 2Easy

Weighted round robin is useful when:

  1. Clients must stick to one server
  2. Servers in the pool have different capacities
  3. All servers are identical
  4. Traffic is very low

Answer: B. Servers in the pool have different capacities

Explanation

Weights let a larger machine receive proportionally more requests than a smaller one.

Step-by-step solution

  1. Weights give each server a share of the traffic.
  2. A larger machine can be given a bigger weight.
  3. Weights matter only when the servers differ in capacity.
  4. So weighted round robin is useful when servers have different capacities (option B).

Why the other options are wrong

  • A. Keeping clients on one server is session affinity, not weighting.
  • C. If all servers are identical, equal shares are enough and weights are not needed.
  • D. Low traffic does not call for weights; the point is capacity differences.

Tip: Use weights when the backend machines are not the same size.

Question 3Easy

What does a reverse proxy do?

  1. Translates IPv4 to IPv6 at the client
  2. Sits in front of servers and forwards client requests to them
  3. Hides clients from the websites they visit
  4. Stores the authoritative DNS records for a domain and answers lookups

Answer: B. Sits in front of servers and forwards client requests to them

Explanation

- A reverse proxy acts for the servers (load balancing, TLS, caching);
- a forward proxy acts for the clients.

Step-by-step solution

  1. A reverse proxy sits in front of backend servers.
  2. Clients talk to it and it forwards requests.
  3. It can add TLS, caching and load balancing.

Why the other options are wrong

  • A. That is NAT64/translation, not a reverse proxy.
  • C. Hiding clients is a forward proxy or VPN.
  • D. That describes an authoritative DNS server.

Tip: Forward = hides clients; reverse = hides servers.

Question 4Easy

What is connection draining (deregistration delay)?

  1. Limiting each client to one connection
  2. Clearing the in-memory cache on each server before every deployment begins
  3. Letting in-flight requests finish before a server is removed
  4. Closing all connections immediately on deploy

Answer: C. Letting in-flight requests finish before a server is removed

Explanation

During deploys or scale-in, draining stops new requests to a server while allowing existing ones to complete, avoiding errors.

Step-by-step solution

  1. When a server is being removed, the balancer stops sending it new requests.
  2. Requests already in flight are allowed to finish during the drain window.
  3. Only then is the server removed.
  4. So connection draining means in-flight requests finish before removal (option C).

Why the other options are wrong

  • A. Limiting each client to one connection is a different rule.
  • B. Clearing caches before a deploy is unrelated to draining connections.
  • D. Closing all connections at once drops in-flight requests, which draining is meant to avoid.

Tip: Draining lets in-flight requests complete, so deploys and scale-in cause fewer errors.

Question 5Medium

What is the key difference between L4 and L7 load balancers?

  1. L4 only works over UDP; L7 only over TCP
  2. L7 is always faster because it does less work per packet than an L4 balancer
  3. L4 can terminate TLS and read cookies
  4. L4 routes on IP/port; L7 can route on HTTP path, host or headers

Answer: D. L4 routes on IP/port; L7 can route on HTTP path, host or headers

Explanation

Layer 4 sees transport-level information; layer 7 parses the application protocol, so it can do path-based routing, cookies and header rules.

Step-by-step solution

  1. L4 works at the transport layer and routes on IP addresses and ports.
  2. L7 works at the application layer and can read HTTP.
  3. So L7 can route by URL path, host or headers.
  4. The key difference is option D.

Why the other options are wrong

  • A. L4 handles both TCP and UDP, and L7 works on HTTP, so the transport split is wrong.
  • B. L7 does more work per request, so it is usually not faster.
  • C. Terminating TLS and reading cookies need application-layer parsing, which is L7, not L4.

Tip: L4 routes on IP and port; L7 routes on the content of the HTTP request.

Question 6Medium

Requests vary widely in duration (some take 20 ms, some 20 s). Which algorithm usually balances better than round robin?

  1. Least connections
  2. Plain round robin
  3. Source IP hash
  4. Random choice with no health checks

Answer: A. Least connections

Explanation

Least connections sends new work to the server with the fewest active requests, adapting to uneven request durations.

Step-by-step solution

  1. Some requests take 20 ms and others 20 s.
  2. Round robin gives each server the same count, so slow requests can pile up on one server.
  3. Least connections sends new work to the server with the fewest active requests.
  4. So least connections balances better here (option A).

Why the other options are wrong

  • B. Plain round robin ignores how long requests take, so it balances worse here.
  • C. Source IP hash pins a client to one server and does not adapt to slow requests.
  • D. Random choice with no health checks ignores load and failures.

Tip: When request times vary a lot, pick least connections over round robin.

Question 7Medium

Least response time balancing chooses the server that:

  1. Was added to the pool most recently and therefore has the warmest caches
  2. Has the fewest active connections and lowest observed latency
  3. Is geographically farthest
  4. Has the largest disk

Answer: B. Has the fewest active connections and lowest observed latency

Explanation

It favours backends currently answering fastest, adapting to slow or overloaded nodes.

Step-by-step solution

  1. Least response time balancing looks at how fast each server is answering.
  2. It also considers how many active connections each server has.
  3. It picks the server with the lowest observed latency and fewest connections.
  4. So the chosen server is the one with fewest active connections and lowest latency (option B).

Why the other options are wrong

  • A. Being added recently is not a measure of response time.
  • C. Geographic distance is a different routing method, not least response time.
  • D. Disk size does not affect which server answers fastest.

Tip: Least response time adapts to slow or overloaded servers by watching live latency.

Question 8Medium

What is TLS termination at the load balancer?

  1. The balancer decrypts HTTPS and forwards requests to backends
  2. Certificates are generated per request by each backend server and sent to the balancer
  3. Backends close the TLS session after every request
  4. The load balancer refuses all TLS connections

Answer: A. The balancer decrypts HTTPS and forwards requests to backends

Explanation

Offloading decryption to the balancer saves backend CPU and centralises certificate management; traffic to backends may be re-encrypted if needed.

Step-by-step solution

  1. The client connects to the load balancer over HTTPS.
  2. The load balancer decrypts the traffic there.
  3. It then forwards the request to backends, which may receive plain or re-encrypted traffic.
  4. So TLS termination means the balancer decrypts HTTPS (option A).

Why the other options are wrong

  • B. Backends do not generate certificates per request for the balancer to send.
  • C. Backends are not required to close TLS after every request; that is not termination.
  • D. The balancer accepts TLS and decrypts it; it does not refuse all TLS.

Tip: Termination at the balancer saves backend CPU and centralises certificates.

Question 9Hard

A service has 4 backends behind round robin. One backend becomes 10x slower but still passes health checks. What happens?

  1. No requests are affected because health checks remove it
  2. All requests become slow
  3. About a quarter of requests become slow
  4. The balancer automatically gives it zero weight once its latency rises

Answer: C. About a quarter of requests become slow

Explanation

Round robin ignores latency, so a degraded-but-healthy node keeps its share; latency-aware or least-connections algorithms would shift load away.

Step-by-step solution

  1. Round robin gives each of the 4 backends the same share, which is 1 in 4.
  2. The slow backend still passes health checks, so it stays in rotation.
  3. Round robin ignores latency, so its quarter of requests stay slow.
  4. So about a quarter of requests become slow (option C).

Why the other options are wrong

  • A. Health checks only test for failure; a slow server that still answers stays in rotation.
  • B. Only the requests sent to the slow backend are affected, not all of them.
  • D. Round robin does not lower a server's weight based on latency.

Tip: A slow but healthy server still takes its full share under round robin; latency-aware methods avoid this.

Question 10Hard

With consistent-hash load balancing to cache servers, what is the advantage over hash(key) mod N?

  1. Servers never need health checks
  2. Every key is copied to every server for safety
  3. Keys are spread in perfect alphabetical order across servers
  4. Adding or removing a server remaps only a few keys

Answer: D. Adding or removing a server remaps only a few keys

Explanation

Mod N remaps most keys when N changes, causing a cache stampede; consistent hashing moves only about 1/N of keys.

Step-by-step solution

  1. With hash(key) mod N, changing N moves most keys to different servers.
  2. Consistent hashing places servers and keys on a ring.
  3. Adding or removing one server moves only the keys next to it on the ring.
  4. So the advantage is that only a few keys are remapped (option D).

Why the other options are wrong

  • A. Consistent hashing does not remove the need for health checks.
  • B. Copying every key to every server is replication, not consistent hashing.
  • C. Consistent hashing spreads keys by hash, not in alphabetical order.

Tip: Consistent hashing limits key movement to about 1 over N of keys when a server changes.

Practise all 22 questions free

The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.

Open this topic in the app →

Related topics

See all System Design topics · All topics