Nest

Test yourself

Quiz — Multiple Choice

Pick an answer; it instantly marks it right or wrong and explains why. Your answers are saved in this browser, so you can come back and finish.

Score 0 / 0 answered · 34 total
  1. Q1Why must a NestJS DTO be a class rather than a TypeScript interface?Core
  2. Q2In the request lifecycle, which runs FIRST?Request Lifecycle
  3. Q3Which building block is the right place for authorization (RBAC)?Request Lifecycle
  4. Q4What is the main cost of making a provider REQUEST-scoped?DI & Modules
  5. Q5You need to inject a value behind an interface. What do you do?DI & Modules
  6. Q6Same service class is listed in two modules' `providers`. What happens?DI & Modules
  7. Q7What does `whitelist: true` on ValidationPipe do?Config & Validation
  8. Q8Which TypeORM setting should NEVER be true in production?Data & ORM
  9. Q9Why register a global guard via APP_GUARD instead of app.useGlobalGuards(new X())?Request Lifecycle
  10. Q10When is CSRF protection NOT needed?Auth
  11. Q11Best practice for storing user passwords?Auth
  12. Q12In a Nest unit test, how do you replace a real dependency with a mock?Testing
  13. Q13What happens when you inject @Res() in a controller without passthrough?Core
  14. Q14Which enhancer is the ONLY one that resolves lowest-level-first (route → controller → global)?Request Lifecycle
  15. Q15What's the recommended first response to a circular dependency?DI & Modules
  16. Q16Best way to catch a missing required env var?Config & Validation
  17. Q17Inside an I/O callback, which fires first: setTimeout(fn, 0) or setImmediate(fn)?Node.js Core
  18. Q18Which of these does NOT use the libuv thread pool?Node.js Core
  19. Q19Why prefer stream.pipeline() over readable.pipe(writable)?Node.js Core
  20. Q20You have a CPU-bound task that must run in-process without blocking requests. Use:Node.js Core
  21. Q21Which Promise combinator resolves with the first FULFILLED value (ignoring rejections unless all fail)?Node.js Core
  22. Q22What does process.nextTick risk if used recursively?Node.js Core
  23. Q23Which decorator pairs with client.emit() for fire-and-forget events?Microservices
  24. Q24Across microservices, how do you keep data consistent without distributed 2PC?Microservices
  25. Q25DataLoader fixes the N+1 problem primarily by:GraphQL
  26. Q26Rate limiting / caching / queues default to in-memory. What breaks across replicas?Performance
  27. Q27Which adapter typically gives ~2× throughput for JSON-heavy APIs?Performance
  28. Q28How do you correctly measure event-loop lag?Performance
  29. Q29The Node.js permission model (--permission) is best described as:Security
  30. Q30An attacker sends `__proto__` in JSON that your deep-merge copies. This is:Security
  31. Q31In a pool-model multi-tenant app, the cardinal sin to prevent is:Architecture
  32. Q32Why must queue/job consumers be idempotent?Queues & Jobs
  33. Q33After an uncaughtException, the recommended action is to:Node.js Core
  34. Q34What's the strongest reason to extract a module into a separate microservice?Architecture