Sample questions
Question 1Easy
Path-based routing like /api to one pool and /images to another requires which balancer?
- A hardware firewall
- Layer 4 (transport) load balancer
- DNS round robin
- 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
- Path-based routing needs to read the URL path of each request.
- That means reading HTTP, which is an application-layer job.
- A Layer 7 (application) balancer parses HTTP and can match /api and /images.
- 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:
- Clients must stick to one server
- Servers in the pool have different capacities
- All servers are identical
- 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
- Weights give each server a share of the traffic.
- A larger machine can be given a bigger weight.
- Weights matter only when the servers differ in capacity.
- 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?
- Translates IPv4 to IPv6 at the client
- Sits in front of servers and forwards client requests to them
- Hides clients from the websites they visit
- 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
- A reverse proxy sits in front of backend servers.
- Clients talk to it and it forwards requests.
- 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)?
- Limiting each client to one connection
- Clearing the in-memory cache on each server before every deployment begins
- Letting in-flight requests finish before a server is removed
- 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
- When a server is being removed, the balancer stops sending it new requests.
- Requests already in flight are allowed to finish during the drain window.
- Only then is the server removed.
- 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?
- L4 only works over UDP; L7 only over TCP
- L7 is always faster because it does less work per packet than an L4 balancer
- L4 can terminate TLS and read cookies
- 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
- L4 works at the transport layer and routes on IP addresses and ports.
- L7 works at the application layer and can read HTTP.
- So L7 can route by URL path, host or headers.
- 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?
- Least connections
- Plain round robin
- Source IP hash
- 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
- Some requests take 20 ms and others 20 s.
- Round robin gives each server the same count, so slow requests can pile up on one server.
- Least connections sends new work to the server with the fewest active requests.
- 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:
- Was added to the pool most recently and therefore has the warmest caches
- Has the fewest active connections and lowest observed latency
- Is geographically farthest
- 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
- Least response time balancing looks at how fast each server is answering.
- It also considers how many active connections each server has.
- It picks the server with the lowest observed latency and fewest connections.
- 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?
- The balancer decrypts HTTPS and forwards requests to backends
- Certificates are generated per request by each backend server and sent to the balancer
- Backends close the TLS session after every request
- 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
- The client connects to the load balancer over HTTPS.
- The load balancer decrypts the traffic there.
- It then forwards the request to backends, which may receive plain or re-encrypted traffic.
- 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?
- No requests are affected because health checks remove it
- All requests become slow
- About a quarter of requests become slow
- 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
- Round robin gives each of the 4 backends the same share, which is 1 in 4.
- The slow backend still passes health checks, so it stays in rotation.
- Round robin ignores latency, so its quarter of requests stay slow.
- 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?
- Servers never need health checks
- Every key is copied to every server for safety
- Keys are spread in perfect alphabetical order across servers
- 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
- With hash(key) mod N, changing N moves most keys to different servers.
- Consistent hashing places servers and keys on a ring.
- Adding or removing one server moves only the keys next to it on the ring.
- 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 →