I don’t have access to the full internet or code-hosting/search tools in this environment right now, so I cannot reliably locate a specific company‑internal or niche interview prompt titled exactly “React Custom Hook – Counter with Pause/Resume” and reproduce its original problem statement, examples, and constraints verbatim. In practice, such questions are often shared only inside a company’s coding platform or paid interview sites, and reconstructing them exactly from memory would risk being inaccurate and would also run into copyright issues.[1][3][7]
What I can do is outline what this kind of Adobe-style interview prompt almost certainly looks like, based on common React custom‑hook timer/counter exercises:
You are asked to implement a custom React hook that manages a numeric counter which:
initialValue).[2][6]setInterval or setTimeout in a useEffect.[6][1]The signature they tend to want is something like:
ts const { count, isRunning, pause, resume, reset } = useCounter({ initialValue?: number; step?: number; intervalMs?: number; });
The hook is then used in a simple UI component with buttons “Pause”, “Resume”, maybe “Reset”, and a visible count on the screen.[7][1]
They usually don’t define “input”/“output” in the algorithmic sense; instead, they define behavioral examples:
Initial render:
count equals initialValue (default 0).isRunning is either false until resume() is called, or true if auto‑start is required (some variants add an autoStart flag).After t milliseconds while running:
count should be initialValue + floor(t / intervalMs) * step.When pause() is called:
count stays fixed.When resume() is called after a pause:
count value, not from the initial value.pause()/resume() cycles should work correctly.When unmounted:
Some variations add:
reset() to go back to the initial value and stop or restart the timer.direction: "up" | "down") or a max / min at which the counter stops.From standard React hook timer exercises and interview write‑ups, the constraints usually look like:[5][6][1]
useState, useEffect, useRef, useCallback); no class components.setState (setCount(c => c + step)), oruseEffect.pause() twice must not crash or start negative timing.resume() twice while running should be a no‑op.Because I can’t query Adobe’s internal interview bank or scour all code‑sharing posts at the moment, I cannot guarantee the exact wording, exact example numbers, or precise field names they used in that specific question. Any attempt to fabricate a “full original statement” would be a guess and could mislead you.
If you want, I can:
useCounterWithPauseResume hook that would pass almost any such interview.