setTimeout(callback, delay)
clearTimeout(timeoutId)
setInterval(callback, interval)
clearInterval(intervalId)
setImmediate(callback)
How would you get the current timestamp in milliseconds since the epoch inside a Node.js service?
If you need to run a function exactly five seconds from now, which built‑in timer would you use and how would you cancel it if needed?
What does Date.now() return and how does it differ from creating a new Date object?
We measure an API call’s duration with Date.now() but sometimes see negative values under load. What could cause that and how would you fix it?
Design a simple rate‑limiter that allows 100 requests per minute. Which timer functions would you choose and why?
Explain why setTimeout callbacks can fire later than the requested delay in a busy Node.js event loop.
Design a high‑resolution performance logger for a microservice that needs sub‑millisecond precision. Which time APIs would you combine and what trade‑offs do they have?
Our distributed system orders events by timestamps, but server clocks drift. How would you redesign time handling to avoid ordering bugs?
During profiling you notice large gaps in process.hrtime readings during GC pauses. How would you account for that in your metrics?
We’re migrating a legacy codebase that uses Date everywhere to a deterministic time abstraction for testing and reproducible builds. What strategy would you propose for abstracting time across the organization?
Discuss the implications of using setTimeout versus a durable message queue with delayed delivery for tasks that must survive process restarts.
How would you establish a company‑wide policy for handling time zones, daylight‑saving changes, and monotonic clocks in both backend services and client‑side JavaScript?