← Amazon Interview Insights

Amazon·Software Engineer·Onsite - System Design / Architecture·Senior

Senior
Jul 2026

Summary

Amazon solutions architect interview with a single system design question about session persistence. Pretty focused, no fluff.

Questions Asked (1)

Q1

For a web application, how would you decide between sticky sessions on the load balancer versus storing session state in a database?

System DesignTechnical Trade-offs
Author's notes

I went straight to the database approach because that's what I'd actually do in production, but I think I undersold the tradeoffs.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the application's requirements, such as scalability, fault tolerance, and session data complexity. Then compare sticky sessions and database-backed sessions across dimensions like scalability, availability, performance, and operational overhead. Finally, recommend a solution based on trade-offs, possibly a hybrid approach, and justify it with concrete examples.

Pro tip: At Amazon, always tie your answer back to customer impact and operational excellence—explain how each option affects availability, latency, and cost, and mention that you'd validate assumptions with load testing and metrics.

1. Clarify Requirements

Ask about expected traffic scale, session data size and complexity, latency requirements, and availability targets. This ensures your recommendation is context-driven.

2. Analyze Sticky Sessions

Discuss pros: simplicity, low latency, no external dependency. Cons: uneven load, poor fault tolerance, scaling challenges, and session loss on instance failure.

3. Analyze Database-Backed Sessions

Discuss pros: stateless servers, easy horizontal scaling, session persistence across failures. Cons: added latency, database load, potential single point of failure, and complexity.

4. Compare Trade-offs

Evaluate both options against scalability, availability, performance, cost, and operational complexity. Consider hybrid approaches like using a distributed cache (e.g., Redis) as a session store.

5. Recommend and Justify

Choose an option based on the requirements, explain why it's the best fit, and mention how you'd mitigate its drawbacks (e.g., database sharding, caching, or session replication).

Key Points to Mention

  • Scalability: sticky sessions hinder horizontal scaling and cause uneven load; database sessions enable stateless servers.
  • Fault tolerance: sticky sessions lose state on instance failure; database sessions persist across failures.
  • Performance: sticky sessions have lower latency; database sessions add network and query overhead.
  • Operational complexity: sticky sessions require load balancer configuration; database sessions need schema design, cleanup, and monitoring.
  • Alternatives: distributed in-memory stores like Redis or Memcached offer a middle ground with high performance and persistence.
  • Amazon context: emphasize availability, customer experience, and cost-efficiency; mention AWS services like ElastiCache or DynamoDB for session storage.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.