Bird
0
0

Which of these is a common example of cross-cutting logic added by interceptors?

easy📝 Conceptual Q2 of 15
NestJS - Interceptors
Which of these is a common example of cross-cutting logic added by interceptors?
AWriting HTML templates
BLogging request and response times
CDefining database schemas
DCreating new API routes
Step-by-Step Solution
Solution:
  1. Step 1: Recall typical cross-cutting concerns

    Logging is a common task that applies across many parts of an app, not tied to business logic.
  2. Step 2: Match with interceptor use

    Interceptors are perfect for logging because they can run code before and after handlers.
  3. Final Answer:

    Logging request and response times -> Option B
  4. Quick Check:

    Cross-cutting example = logging [OK]
Quick Trick: Logging is a classic cross-cutting concern handled by interceptors [OK]
Common Mistakes:
  • Confusing schema definition with interceptor role
  • Thinking interceptors create routes
  • Assuming interceptors handle HTML

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More NestJS Quizzes