Skip to content

Testing strategy under a time-box

A few chosen tests: each rule at its edge, one main journey, and a written list of what stays untested.

Predict first

Before you read: predict

A 4-hour ExamHall take-home: the exam timer. The task sheet sets three rules: an answer received by the deadline is accepted; one whose upload began before the deadline is accepted up to 30 seconds after it; at the deadline the app submits the last saved draft. It names one journey, “a candidate submits just before time runs out”. The features work, and 45 minutes of the box are left for tests.

Which plan fits the advice in Ham Vocke's The Practical Test Pyramid (martinfowler.com)?

Pick one

The 30-second version

Tests come out of the take-home's stated time, so choose them. Give each rule the brief states a small test at the edge its wording sets, add one test of the journey the brief names, and control what you don't own. Then write down what you didn't test. Zero tests and full coverage both miss.

A few chosen tests: each rule at its edge, one main journey, and a written list of what stays untested.

How it works

Step 1 of 11

Budget tests early. Their minutes come from the box that takehome-scope-and-timebox step 5 sets; plan them before the last feature.

Analogy: A museum technician's last two hours before an exhibition opens

The doors open at ten. The technician cannot check everything, so she checks each display case's alarm with a hand at exactly the distance its spec sets, then walks the visitor route once, entrance to exit, without tripping every alarm again. The alarm company's control room is not hers, so she puts the panel in test mode. What she could not check goes on a snag list for the morning manager.

Before the exhibition opens In the take-home
Two hours before the doors open The minutes of the box left for tests
Each case's alarm, a hand at exactly its set distance Each rule tested at the edge its wording sets
One walk of the visitor route One test of the main journey
No alarm tripped a second time on the walk The journey test leaves the rules' edges to their own tests
The alarm panel in test mode A fixed reply for a service you don't own
The snag list: "lift to gallery 3 not checked" The list of what stays untested

Breaks down when: an alarm checked tonight stays as it is, while code changes with every commit and the tests run again each time. Wrong inference: “a check done once by hand is as good as a test.”

In real terms: spend the test minutes on the rules' edges and one journey, and write the rest down.

Try it

Answer first, then check. Nothing is saved.

Question 1 of 7

A streaming take-home's task sheet: “Continue watching lists episodes watched for 2 minutes or more and less than 90% of the way through, at most 10 of them, the most recently watched first.” The candidate's code and tests:

// row.test.mjs
const ep = (id, watched, lastAt = 0) => ({ id, watched, length: 1800, lastAt });
it('hides a short view', () => expect(continueWatching([ep('a', 119), ep('b', 121)])).toEqual(['b']));
it('drops a finished episode', () => expect(continueWatching([ep('a', 1620), ep('b', 900)])).toEqual(['b']));
it('keeps ten', () => expect(continueWatching([...'abcdefghijkl'].map((id) => ep(id, 900)))).toEqual([...'abcdefghij']));
it('newest first', () => expect(continueWatching([ep('a', 900, 1), ep('b', 900, 2), ep('c', 900, 3)])).toEqual(['c', 'b', 'a']));

In the review the engineer makes four one-line edits to row.mjs, one at a time, and reruns her tests: (1) >= 120 becomes > 120; (2) < 0.9 becomes <= 0.9; (3) slice(0, 10) becomes slice(0, 11); (4) the sort becomes a.lastAt - b.lastAt.

How many of the four edits turn at least one test red?

Code for this question
// row.mjsexport function continueWatching(history) {  return history    .filter((e) => e.watched >= 120 && e.watched / e.length < 0.9)    .sort((a, b) => b.lastAt - a.lastAt)    .slice(0, 10)    .map((e) => e.id);}
Pick one

Question 2 of 7

A 4-hour streaming take-home. At 3 h 05 min the features work and nothing is tested. Her price list: the resume journey test (pick an episode from Continue watching and resume it, through the API), 20 min; the README's “Not tested” section, 10 min; and rule tests at 5 min each, of which she would like 8. She works through the items in one order and submits at the 4-hour mark; anything unfinished then is left out.

Which order still submits both the journey test and the “Not tested” section?

Pick one

Question 3 of 7

A streaming take-home's episode page shows an Up next row filled by a recommendations service; the task sheet gives her a sandbox key for it. Her one journey test opens an episode in the browser and checks the Up next row. In CI it fails now and then: the service answers slowly, or sends different picks.

Which change fits Playwright's best-practices guide (as of 2026-10-06)?

Pick one

Question 4 of 7

Her streaming take-home's three Continue watching rules have unit tests at their edges. She now writes the one journey test: pick an episode from the row and press play.

Which assertions fit Vocke's The Practical Test Pyramid and Playwright's best-practices guide (both as of 2026-10-06)?

Pick one

Question 5 of 7

A streaming take-home's task sheet: “Play resumes an episode at its saved position. With 60 seconds or less left after that position, play starts the next episode at 0 instead. A position saved more than 30 days ago is ignored, and the episode starts at 0.” The route createApp(store, clock).play(profileId, episodeId) returns { episodeId, at }; the rules live in resumePoint(saved, episode, now), in seconds. You have 45 minutes: the “Not tested” list takes 5, a rule test 5 and a journey test 15.

Write your plan: the tests, each marked rule or journey, and at least two untested cases.

Question 6 of 7

The review call for her streaming take-home. The task sheet: “Skip intro shows while at least 5 seconds of the intro remain, and stays hidden for the first 3 seconds after playback resumes.” Her rule tests: shown at the intro's first second; shown with 5 s of the intro left; hidden with 4 s left; hidden 2 s after a resume. Her one journey test resumes an episode mid-intro through the API and reads the button's state. Her player module also exports introEnd(ep), which returns ep.introStart + ep.introLength, with no test. All green. The engineer asks what's missing from her tests.

Which answer fits The Practical Test Pyramid (as of 2026-10-06)?

Pick one

Question 7 of 7

The task sheet: “When an episode's credits start, the next episode plays 10 seconds later, unless the viewer presses Cancel.” She runs her tests with node:test's mock timers: setTimeout is mocked afresh in each test, and mock.timers.tick(ms) moves the clock forward ms milliseconds.

// autoplay.test.mjs
it('waits ten seconds', () => { let n = 0; startCountdown(() => n++); mock.timers.tick(9_000); expect(n).toBe(0); mock.timers.tick(2_000); expect(n).toBe(1); });
it('Cancel stops it', () => { let n = 0; const t = startCountdown(() => n++); mock.timers.tick(5_000); t.cancel(); mock.timers.tick(10_000); expect(n).toBe(0); });

The engineer makes four one-line edits, one at a time, and reruns her tests: (1) 10_000 becomes 9_000; (2) it becomes 11_000; (3) it becomes 12_000; (4) cancel clears nothing.

How many of the four edits turn at least one test red?

Code for this question
// autoplay.mjsexport function startCountdown(playNext) {  const timer = setTimeout(playNext, 10_000);  return { cancel: () => clearTimeout(timer) };}
Pick one

Go deeper

Pro tip

Open the README's “Not tested” section when you write your first test, and add a line each time you decide to skip one; at the end it is already written.

Checked against the tools and docs as of 2026-10-06.