Bird
0
0

Which of the following best describes how setInterval schedules repeated tasks?

easy📝 Conceptual Q2 of 15
Node.js - Timers and Scheduling
Which of the following best describes how setInterval schedules repeated tasks?
AIt schedules the next call only after the previous call finishes.
BIt schedules calls at fixed intervals regardless of task duration.
CIt schedules calls randomly within the interval time.
DIt schedules calls only once and then stops.
Step-by-Step Solution
Solution:
  1. Step 1: Review setInterval behavior

    setInterval triggers the callback repeatedly at fixed time intervals, without waiting for the previous call to finish.
  2. Step 2: Compare with other options

    Options A, B, and C do not correctly describe setInterval scheduling.
  3. Final Answer:

    It schedules calls at fixed intervals regardless of task duration. -> Option B
  4. Quick Check:

    Fixed interval scheduling = D [OK]
Quick Trick: setInterval ignores function execution time, fixed intervals [OK]
Common Mistakes:
  • Assuming setInterval waits for function to finish
  • Confusing setInterval with recursive setTimeout
  • Thinking setInterval schedules only once

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Node.js Quizzes