Easy👤 0-2 years👤 3-5 years 1 min read

What does 'stateless' mean in REST, and how does it enable horizontal scaling?

Asked inAmazonInfosysCognizantDeloitte
#stateless#session#scaling#load balancing#rest
Report issue

⚡ Short Answer

Each request must carry everything the server needs (auth token, params) — the server keeps no client session between requests. That lets any instance handle any request, so you can scale out behind a load balancer without sticky sessions.

Coffee Chat Question

Concept Made Simple

What does 'stateless' mean in REST, and how does it enable horizontal scaling?

🧠Mind Map Answer

Remember It Faster

Stateless = no server-side session tied to a client. Every request is self-contained, so request #2 can hit a different instance than request #1 with no shared memory needed.

🔥What If?

Think Beyond the Expected

If REST is stateless, where does session/login state go?

Into a self-contained token (JWT) the client sends each request, or into a shared external store (Redis) all instances read. The key is the app server stays stateless — state lives in the token or a shared store, not in instance memory.

😂Real World

Statelessness is why you can autoscale API pods freely; the moment someone stores session in instance memory, you need sticky sessions and lose elastic scaling — a common scaling regression.

🎯Interviewer's Expectation

Keywords they're listening for:

self-contained requestsno server sessionany instance handles any requesttoken or shared store for stateno sticky sessions

⚠️Common Mistakes

  • Storing session state in instance memory
  • Requiring sticky sessions (defeats scaling)
  • Confusing statelessness with 'no database'

Best Practices

  • Keep app servers stateless
  • Use tokens or a shared store for state
  • Avoid sticky sessions where possible

🔁Follow-up Questions

  • 1What breaks if you store session in instance memory?
  • 2JWT vs server-side session in Redis — trade-offs?
  • 3How do you handle logout with stateless JWTs?

🧩Related Technologies

JWTRedisload balancerKubernetes HPA

Continue Learning with AI

Take this question deeper with your favourite AI assistant. Pick a depth, copy the prompt, or open it directly — AI is your learning companion, not a shortcut.

Plain-language foundations

I'm preparing for a software engineering interview and want to understand this from scratch, as a beginner.

Topic: Auth (REST APIs)
Interview question: "What does 'stateless' mean in REST, and how does it enable horizontal scaling?"

Please:
1. Explain the core idea in simple, plain language, using an everyday analogy.
2. Define any technical terms you use.
3. Walk through one small, concrete example.
4. Finish with a single sentence I can easily remember.

Keep the tone friendly and assume I'm new to this topic.
Open inChatGPTGeminiClaude

Was this answer helpful?

Support our platform by exploring our recommended products.

As an Amazon affiliate, purchases through these links may earn us a small commission — at no extra cost to you. It helps keep Full Stack Interview Guru free.

Related Questions