Timers interview questions
Practice 42 questions on timers. Each runs in a real in-browser editor with Jest tests and a worked, diagram-backed solution.
42 questions
- JavaScriptCoding exercise
Cancellable Interval
EASYImplement a setInterval wrapper that returns a function which stops the interval when invoked.
15 minCoinbasePractice - JavaScriptCoding exercise
Cancellable Timeout
EASYImplement a setTimeout wrapper that returns a function you can call to cancel the pending callback.
15 minPractice - UI / FrameworksUI challenge4 variants
Copy to Clipboard Button
EASYBuild a button that copies text to the clipboard and shows a transient copied confirmation.
15 minPractice - UI / FrameworksUI challenge4 variants
Countdown Timer
EASYBuild a countdown timer that ticks down from a start time and can start, pause, and reset.
15 minPractice - JavaScriptCoding exercise
Debounce
EASYImplement a function that delays invoking another function until a specified period of inactivity has passed.
15 minAdobe · Airbnb · Amazon +26Practice - JavaScriptCoding exercise
Sleep
EASYImplement a function that returns a promise resolving after the specified number of milliseconds.
15 minAmazon · LinkedIn · NetflixPractice - JavaScriptCoding exercise
Sliding TTL Cache
EASYImplement a cache whose entries expire a fixed time after their last access, not after being set.
15 minPractice - UI / FrameworksUI challenge4 variants
Toast Notification
EASYBuild a toast that appears on trigger and auto-dismisses after a few seconds, with manual close.
15 minPractice - UI / FrameworksUI challenge4 variants
Traffic Light
EASYBuild a traffic light that cycles green to yellow to red on a timer and loops indefinitely.
15 minRoblox · Snowflake · Spotify +1Practice - JavaScriptCoding exercise
Typewriter Pacer
EASYBuffer bursty streamed text and emit it one character at a time at a steady cadence, with flush and stop controls.
18 minPractice - UI / FrameworksUI challenge4 variants
Analog Clock
MEDIUMBuild an analog clock whose hour, minute, and second hands move smoothly to reflect the current time.
25 minLyftPractice - JavaScriptCoding exercise
Analytics Event SDK
MEDIUMBuild an analytics client that queues tracked events, flushes them in batches, and retries failed sends with backoff.
25 minPremium questionPractice - JavaScriptCoding exercise
Async Debounce (Latest Wins)
MEDIUMImplement an async debounce that resolves only the newest call and discards the results of superseded ones.
25 minPractice - JavaScriptCoding exercise
Async Memoize with TTL
MEDIUMImplement an async memoize that caches results by key for a TTL and coalesces concurrent calls for the same key.
25 minPractice - UI / FrameworksUI challenge4 variants
Autoplay Carousel
MEDIUMBuild a carousel that auto-advances, wraps, pauses on hover or focus, and supports manual controls.
25 minPractice - JavaScriptCoding exercise
Batch Event Flusher
MEDIUMBuffer events and flush them in batches when a size threshold or a max-wait timer is reached.
25 minPremium questionPractice - JavaScriptCoding exercise
Debounce II
MEDIUMExtend debounce with cancel and flush methods to abort or immediately invoke pending calls.
25 minAirbnb · Flipkart · Google +6Practice - JavaScriptCoding exercise
Debounce III
MEDIUMExtend debounce with a maxWait option that forces a call after a maximum delay even under constant activity.
25 minPremium questionPractice - UI / FrameworksUI challenge4 variants
Digital Clock
MEDIUMBuild a 7-segment style digital clock that updates to display the current time.
25 minLyftPractice - UI / FrameworksUI challenge4 variants
Grid Lights
MEDIUMBuild a grid of cells that light up on click and then deactivate one by one in the reverse order they were activated.
25 minUberPractice - UI / FrameworksUI challenge4 variants
Memory Game
MEDIUMBuild a memory card-matching game where players flip cards to find matching pairs.
25 minRoblox · SnowflakePractice - UI / FrameworksUI challenge4 variants
Progress Bars II
MEDIUMBuild a list of progress bars that fill in sequence, each one starting only after the previous bar finishes.
25 minPremium questionUberPractice - JavaScriptCoding exercise
Promise Timeout
MEDIUMImplement a function that races a promise against a timer and rejects if the promise doesn't settle in time.
25 minPractice - JavaScriptCoding exercise
Resilient Fetch Wrapper
MEDIUMWrap an async call with retries, backoff, and a per-attempt timeout so transient failures recover.
25 minPractice - JavaScriptCoding exercise
Resumable Interval
MEDIUMImplement an interval helper that exposes start, pause, and resume controls while preserving elapsed progress.
25 minPractice - UI / FrameworksUI challenge4 variants
Snake Game
MEDIUMBuild the classic snake game on a grid with keyboard control, growth on eating, and game over.
25 minPractice - JavaScriptCoding exercise
Stale-While-Revalidate Cache
MEDIUMReturn cached data instantly, serving stale values while revalidating them in the background.
25 minPractice - UI / FrameworksUI challenge4 variants
Stopwatch
MEDIUMBuild a stopwatch widget that measures elapsed time with start, stop, and reset controls.
25 minCisco · Lyft · Shopify +2Practice - JavaScriptCoding exercise
Throttle
MEDIUMImplement a function that limits how often a wrapped function can be invoked within a time window.
15 minAdobe · Amazon · Atlassian +20Practice - JavaScriptCoding exercise
Throttle II
MEDIUMExtend throttle with cancel and flush methods plus leading and trailing edge options.
25 minPremium questionPractice - JavaScriptCoding exercise
useCountdown
MEDIUMImplement a hook that drives a countdown timer with start, pause, and reset controls.
25 minWalmartPractice - JavaScriptCoding exercise
useCountUp
MEDIUMImplement a hook that animates a number to a target over a fixed duration, independent of the display's framerate.
25 minPractice - JavaScriptCoding exercise
useDebounce
MEDIUMImplement a hook that returns a debounced version of a value, updating only after a quiet period.
25 minAdobe · UberPractice - JavaScriptCoding exercise
useIdle
MEDIUMImplement a hook that flags the user as idle after a period without keyboard, pointer, or scroll activity.
25 minPractice - JavaScriptCoding exercise
useInterval
MEDIUMImplement a hook that runs a callback on a timer with a configurable, pauseable delay.
25 minPractice - JavaScriptCoding exercise
useRafState
MEDIUMImplement a useState variant that defers commits to the next animation frame, so rapid updates coalesce to at most one render per frame.
25 minPractice - JavaScriptCoding exercise
useTimeAgo
MEDIUMImplement a hook that formats a timestamp as relative time like "3 minutes ago" and refreshes itself as time passes.
25 minPractice - JavaScriptCoding exercise
useTimeout
MEDIUMImplement a hook that runs a callback after a given delay and cleans up when the component unmounts.
25 minPractice - UI / FrameworksUI challenge4 variants
Whack-A-Mole
MEDIUMBuild the arcade game where moles randomly appear in a grid and players click them to score.
25 minLyftPractice - JavaScriptCoding exercise
Cooperative Scheduler
HARDRun a queue of tasks in time slices, yielding control between them so the main thread stays responsive.
40 minPremium questionPractice - UI / FrameworksUI challenge4 variants
Progress Bars IV
HARDBuild progress bars that fill concurrently up to three at a time, and let the user pause and resume each one.
40 minPremium questionUberPractice - UI / FrameworksUI challenge4 variants
Tetris
HARDBuild Tetris with falling tetrominoes, rotation, line clears, and scoring.
40 minPremium questionPractice