All jobs / Full-stack developer / Testing
Full-stack developer interview question · 3–5 years
How do you test the parts that are not a request — an incoming webhook and a nightly job?
The strongest answer
Call the handler directly with a recorded payload, signature check included, and replay it to prove it is idempotent; run the job’s function against a seeded database and assert the rows it changed
Why it works
Exactly — the schedule and the delivery are infrastructure; the logic behind them is ordinary code you can call with real payloads.
What a good answer covers
- Separate the trigger from the logic.
- Call handlers with recorded payloads.
- Replay one to prove idempotency.
- Assert the rows, not the schedule.
Answers that fall short
- Close, but not the strongest: Trigger both in a test environment and check the result in the database afterwards
That is a useful smoke test, and it depends on timing and an environment, so it will not run on every pull request. - Weak: Watch the logs after the next nightly run to confirm that it worked
Reading logs the next morning is observation, not a test: nothing fails the build when the logic breaks. - Red flag: They are hard to test automatically, so we verify them by hand when something is reported
Webhooks and jobs are where money and data move quietly; “we hear about it when users complain” is the worst possible detector.
Who gets asked this
More Testing questions
- Someone deleted a required field and merged because the unit tests still passed. What should CI do?
- The end-to-end suite passes alone and fails when it runs in parallel. What is wrong with the test data, and…
- How do you stop the API from breaking the UI in CI?
- Where should the end-to-end suite run in CI — against shared staging, or against a stack built for the run?
- What would you run against production itself, and what must such a check never do?
- You inherit a slow, flaky suite the team has learned to ignore. What is your strategy for the next quarter?
- You built a feature that touches a React screen and two API endpoints. Which tests do you write, and where?
- You are writing your first tests for a POST endpoint. What do you actually assert?