System Design Medium Software Engineer Backend DevOps/SRE

Design a distributed session management system for a global enterprise SaaS application.

Practise this question with AI feedback

Record your spoken answer or type your response to receive immediate scoring and STAR improvements.

💡 Suggested Approach & Sample Answer

Architecture & Identity Architecture:
- Goal: Maintain secure user authentication and instant revocation capabilities across multiple cloud regions with zero single points of failure.

1. Token Strategy: Hybrid JWT + Opaque Session Reference:
- Pure Stateless JWTs cannot be revoked instantly without complex blocklists.
- Hybrid Architecture: Issue short-lived stateless JWTs (10-minute expiry) for fast local API verification, paired with a cryptographically random refresh token stored in a distributed datastore.

2. Distributed Session Datastore:
- Clustered Redis with cross-region active-active replication (Redis Enterprise or AWS ElastiCache Global Datastore) or distributed DynamoDB with Global Tables.
- Session record: { session_id, user_id, device_fingerprint, ip_address, created_at, last_active, is_revoked }.

3. Security & Revocation Mechanics:
- Instant Global Revocation: Setting is_revoked = true in the session store or updating a user's token_version invalidates all refresh attempts immediately.
- Sliding Expiration: Refresh token rotation issues a new refresh token upon every use, detecting token theft and automatic session hijacking.
- Cookie Security: Store tokens in HttpOnly, Secure, SameSite=Strict cookies to eliminate XSS and CSRF exposure.

🎯 What Interviewers Listen For

How would you answer this in a real interview?

Use our free AI mock practice tool to test your response, analyze speaking pacing, and refine your STAR structure.

🧭 New to system design interviews?

Read the step-by-step system design interview guide: a 45-minute framework, the building blocks interviewers expect, and common mistakes.

🔗 Related System Design Questions