Interviewer Smirked at Redis-Stored Tokens? Here's How to Turn It Into a Design Discussion
The piece rescues a very common interview scenario from the false binary of stateless-JWT perfection versus stateful-session pragmatism, giving engineers a repeatable framework to justify architectural choices with business rationale and trade-off awareness. For anyone who codes auth systems, it also prods deeper engineering details like token hashing, TTL layering, and user-scoped indexes that separate a hand-wavy answer from a production-grade one.
In a Chinese tech interview, a candidate who said tokens were stored in Redis got a mocking smile. The author, IT规划师, argues that smile signals either a stress test or a rigid belief that stateless JWT is the only correct answer. The response should not be to argue superiority but to clarify definitions, acknowledge JWT's strengths, then explain why the business required server-side session state.
The article lays out a four-step response: first, concede that pure JWT is elegant; second, describe specific pain points like instant revocation, multi-device limits, and dynamic permission changes that pure JWT can't handle without extra infrastructure; third, proactively admit the costs such as extra Redis calls, middleware dependency, and failover complexity; fourth, state when you would choose JWT, such as for short-lived credentials or open platform calls.
Beyond the conversation strategy, the piece offers concrete technical depth: store only hash or jti, not full tokens; layer TTL for access vs refresh tokens; maintain per-user token sets for bulk logout; and plan for Redis failure with clustering, timeouts, and graded degradation. It closes with a 60-second verbal script and advice to ask the interviewer how they handle session state, turning the interrogation back into a mutual technical discussion.
The fundamental reason this answer works is that it treats the interview as a requirements-analysis exercise, not a trivia contest; a candidate who can map a technical decision to business pain points demonstrates more seniority than one who memorized the 'stateless JWT is best' sermon.
The article subtly points out that pure JWT revocation is usually implemented by adding a blacklist that still requires Redis-like storage, so claiming JWT is stateless is often a half-truth in real systems with logout or ban requirements.
The suggestion to store token hashes rather than full tokens shows a security mindset beyond basic interview prep; many junior engineers overlook the difference between a reversible credential and a reference to one.
The recommended deflection question at the end ('how do you handle session state?') is a clever negotiation tactic that turns the interviewer's judgment into a shared engineering discussion, but it requires the candidate to be confident enough to ask it without coming across as arrogant.