Interview Q&A / AWS & Cloud

IntermediateQuick answer1 min readUpdated 3 Oct 2026

How does an Application Load Balancer route requests to different services?

SHORT ANSWER

An ALB listener evaluates rules in priority order. Each rule has conditions, such as path, host header, HTTP header or query string, and an action, usually forward to a target group. A default rule catches everything else.

Explain it simply

An ALB is like the help desk at a hospital: the board says orthopaedics goes to floor 2, paediatrics to floor 3, and everything else to reception. Each visitor is checked against the rules from top to bottom and sent to the first match.

Example

text
Listener HTTPS :443

Priority 1  host = api.example.com            -> forward to tg-api
Priority 2  path = /images/*                  -> forward to tg-static
Priority 3  path = /admin/* AND source-ip in
            office range                      -> forward to tg-admin
Default     (no rule matched)                 -> forward to tg-web

Other actions
  redirect  HTTP :80 -> HTTPS :443
  fixed-response  return 503 maintenance page
  authenticate  with Amazon Cognito or OIDC

Each target group has its own health check and its own targets, which may be EC2 instances, IP addresses, containers or Lambda functions. The ALB sends traffic only to healthy targets.

This lets one load balancer front many microservices, reducing cost compared with one load balancer per service. Rules are evaluated in priority order, so put specific rules first.

What to say in the interview

"An ALB listener checks rules by priority, matching on host, path, headers or query strings, then forwards to a target group with its own health checks, or redirects or returns a fixed response. One ALB can front many microservices this way."

Common mistakes

  • Putting a broad rule at a higher priority than specific ones, which shadows them.

#aws#alb#load-balancer#microservices

Related questions

Practise more AWS & Cloud questions

Test your recall with short answers, then return to the detailed explanations when you need context.

Open AWS & Cloud quick answers →

Get new questions like this by email

One short email when something new and useful lands. No spam, unsubscribe in one tap.

By subscribing you agree to the Privacy Policy.