Bird
0
0

A developer wrote a REST API that stores user login state on the server between requests. What is the main issue with this approach?

medium📝 Debug Q6 of 15
Rest API - REST API Fundamentals
A developer wrote a REST API that stores user login state on the server between requests. What is the main issue with this approach?
AIt breaks the statelessness requirement, reducing scalability
BIt improves statelessness by caching data
CIt ensures each request is independent
DIt follows REST principles perfectly
Step-by-Step Solution
Solution:
  1. Step 1: Identify storing login state effect

    Storing login state means server keeps session info, breaking statelessness.
  2. Step 2: Understand impact on scalability

    Stateful servers are harder to scale because session data must be shared or synced.
  3. Final Answer:

    It breaks the statelessness requirement, reducing scalability -> Option A
  4. Quick Check:

    Storing state breaks statelessness and scalability [OK]
Quick Trick: Avoid server-side session storage for REST APIs [OK]
Common Mistakes:
MISTAKES
  • Thinking caching improves statelessness
  • Believing requests remain independent
  • Assuming it follows REST perfectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes