Back to programming Quizzes

NestJS Quiz ( Advance )

This advanced NestJS quiz is designed for senior backend developers and architects preparing for high-level interviews. It focuses on NestJS internals, dependency injection mechanics, request lifecycle, performance optimization, microservices, GraphQL, security, testing strategies, and real-world production scenarios.

15
Questions
~8
Minutes
8
Min Limit

Try a few sample questions

The question bank contains 45 questions. Your scored round uses up to 15 different questions. These samples are excluded from your round; try each one before opening its answer and explanation.

1. Why is dependency injection central to NestJS architecture?

  1. It improves routing speed
  2. It enables loose coupling and testability
  3. It replaces middleware
  4. It simplifies HTTP adapters
Reveal sample answer and explanation

Answer: It enables loose coupling and testability

DI promotes loose coupling and easier testing.

2. What happens internally when a request-scoped provider is used?

  1. A single instance is reused
  2. A new instance is created per request context
  3. It becomes transient
  4. It is cached globally
Reveal sample answer and explanation

Answer: A new instance is created per request context

Request-scoped providers are created per request.

3. What is the biggest performance drawback of request-scoped providers?

  1. Memory leaks
  2. Increased instantiation overhead
  3. Broken dependency graph
  4. Lost singleton behavior
Reveal sample answer and explanation

Answer: Increased instantiation overhead

They increase object creation cost per request.