IntermediateTECHNICAL
In one of your recent services, how did you implement authentication and authorization end-to-end (front end, back end, and storage)? Be specific about token handling, session management, protecting routes, and how you enforced role/permission checks in code.
Full Stack Developer
General

Sample Answer

On my last project, I helped design auth for a customer portal used by about 40k monthly active users. We went with a stateless JWT-based approach. On login, the backend (Node/Express) issued a short-lived access token (15 minutes) and a refresh token (7 days). The refresh token was stored in an HTTP-only, Secure, SameSite=Lax cookie; the access token lived only in memory on the client to avoid XSS-related theft. On the React side, I wrapped the app in an AuthProvider that decoded the JWT, cached the user/roles, and used a PrivateRoute component to protect routes and redirect to /login when unauthenticated. Role-based checks were enforced both in the UI (e.g., hiding admin buttons) and, more importantly, in the API layer using middleware. Each route declared required permissions, and the middleware validated them against a roles-permissions table in Postgres. We also stored a token version per user so we could instantly revoke all refresh tokens on password reset or account compromise.

Keywords

JWT-based auth with short-lived access and refresh tokensSecure storage using HTTP-only cookies and in-memory access tokensRoute protection via React PrivateRoute and backend middlewareRole/permission checks via DB-backed RBAC and token versioning for revocation
Related Questions

In your civil engineering studies, what specific design coursework or project work did you complete related to irrigation channels or canals (e.g., design of lined/unlined canals, distributaries, minors)? Describe one such design in detail, including how you determined discharge, permissible velocity, section dimensions, and lining choice for Gujarat-type soil and climate conditions.

IntermediateTECHNICAL

Based on your hydrology and irrigation engineering background, explain how you would estimate the irrigation water requirement for a kharif crop in a semi-arid region of Gujarat. Walk me through each step: from reference evapotranspiration estimation, crop coefficient selection, effective rainfall calculation, to arriving at canal discharge for a given command area.

IntermediateTECHNICAL

Walk me through a recent multi-channel digital marketing campaign you managed end-to-end. How did you set objectives, choose channels, allocate budget, and measure success?

IntermediateBEHAVIORAL

In your resume you note improving or optimizing [a process, KPI, or metric]. What specific baseline metrics did you start from, what steps did you personally take, and how did you verify that the improvement was due to your changes rather than external factors?

IntermediatePROBLEM_SOLVING

On your resume you mention working on a cross-functional project (e.g., involving multiple teams or stakeholders). Describe a situation from that project where priorities conflicted—how did you navigate the trade-offs and what was the final outcome?

IntermediateSITUATIONAL