IntermediateTECHNICAL
Walk me through how you would design and implement user authentication and authorization for a single-page application backed by a REST API. Include how you’d handle password storage, session management or tokens, and protecting specific frontend routes and backend endpoints.
Full Stack Developer
General

Sample Answer

I’d use a stateless JWT-based approach. On signup/login, the Node.js/Express API hashes passwords with bcrypt (12–14 rounds) and stores only the hash and a per-user salt in PostgreSQL. On successful login, the API issues a short-lived access token (15 min) and a long-lived refresh token (7 days), both signed with HS256 and stored in HttpOnly, Secure cookies. The SPA (React/Redux) reads auth state from an in-memory store and protects routes via a higher-order component that checks token presence and role claims (e.g., admin, user). On expiration, it silently refreshes using the refresh token. On the backend, Express middleware validates JWTs, checks RBAC rules, and rate-limits login endpoints. This design cut auth-related support tickets by 40% and reduced unauthorized access attempts by 60% via strict server-side checks.

Keywords

Secure password storage with bcrypt and proper saltingJWT-based access and refresh tokens with HttpOnly, Secure cookiesRoute guards on frontend and RBAC middleware on backendClear token expiry, refresh, and revocation strategy
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