2–5 years · Mid — Node.js · Express · MongoDB · React · REST APIs · Authentication
Implements a refresh token strategy where the access token is short-lived while the refresh token has a longer lifespan; stores refresh tokens securely, ideally in HttpOnly cookies; uses a secure endpoint to exchange refresh tokens for new access tokens; considers revocation strategies for compromised tokens.
What measures would you take to mitigate the risk of token theft?
Analyses current component structure and API responses; retrieves additional fields from the backend; ensures backward compatibility for existing users; implements lazy loading for new data; tests to confirm no degradation in performance.
The new data fields change frequently. How would you ensure the component remains adaptable to future changes?
Considers the access patterns, ensuring frequent queries can be optimised; mentions embedding comments if they are always accessed with the post; discusses referencing if comments are large or needed independently; evaluates trade-offs in data duplication and consistency; considers future scalability.
What would change if comments needed to be updated frequently?
Specifies the feature's purpose and context; details the technologies used and design choices made; explains challenges faced and how they were overcome; reflects on what could be improved in future implementations; mentions team collaboration and feedback received.
What would you change if you were to start that feature again?
Reviews performance metrics to identify impacted routes; checks recent code changes for resource-heavy operations; uses logging to trace execution paths; inspects database queries for inefficiencies; isolates the feature to test in a staging environment.
You find that a third-party API call is the bottleneck. What changes would you make to mitigate this issue?
Defines clear resource-oriented endpoints like /products, /products/{id}, using HTTP methods appropriately; includes pagination and filtering for /products; implements versioning in the URL (e.g., /v1/products) to avoid breaking changes; emphasises proper status codes for different response scenarios.
How would you handle changes to the data structure without breaking existing clients?
Load six more — you will get questions you have not seen first.
Give me six more →Say your answer out loud before revealing. Reading the answer first feels like learning and is not.