Bird
0
0

What will happen if you apply a TimeoutInterceptor with a 0 millisecond timeout?

medium📝 component behavior Q5 of 15
NestJS - Interceptors

What will happen if you apply a TimeoutInterceptor with a 0 millisecond timeout?

ATimeoutInterceptor will be ignored
BRequests will never timeout
CTimeout will default to 5 seconds
DAll requests will immediately timeout and throw errors
Step-by-Step Solution
Solution:
  1. Step 1: Understand timeout value effect

    A 0 millisecond timeout means the observable must emit immediately or it times out.
  2. Step 2: Predict behavior for normal requests

    Since no request can respond instantly, all will timeout immediately and throw errors.
  3. Final Answer:

    All requests will immediately timeout and throw errors -> Option D
  4. Quick Check:

    Zero timeout causes instant errors [OK]
Quick Trick: Zero timeout means no waiting, immediate error [OK]
Common Mistakes:
  • Thinking zero disables timeout
  • Assuming default timeout applies
  • Believing interceptor is ignored

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More NestJS Quizzes