NestJS interview practice.
Rehearse with explained interview questions. Describe the mechanism, trace an example, and explain a trade-off before revealing the answer.
How to use this session
- Choose a level and session length. Try each prompt before opening the notes.
- Compare your explanation with the source answer and revisit any concept you missed.
- Mark the questions you reviewed. Sign in to save session history; your draft answers stay in this page.
Code is provided for reading and tracing. These sessions do not execute or automatically grade code.
NestJS practice
Think first. Reveal second.
Explain your reasoning before opening the notes. A focused session lets you choose your question count; mock rounds follow the original guide.
Loading your question pool…
Preview the NestJS question pool
- What are modules, controllers and services?
Nest modules define feature boundaries and register the controllers and providers that belong to a feature. Controllers handle transport concerns, while services usually contain business rules. This separation makes code easier to reuse and test without tying every decision to HTTP.
- How does dependency injection work?
Dependency injection means a class receives the objects it needs instead of constructing them itself. Nest's container uses registered provider tokens to build and connect these dependencies. This centralizes construction and lets tests or configuration replace an implementation without rewriting its consumers.
- Why does Nest say it cannot resolve a dependency?
A dependency-resolution error means Nest cannot find or create a required provider in the current module context. The class may exist in source code but still be invisible to the consumer's module. Troubleshooting should follow the token, registration, export and import path.