UNDERSTAND
Bring these concepts with you
BUILD
Your implementation
- Implement verifySortProperties(sortFn) testing empty, singleton, duplicate, negative, and reversed inputs.
- Assert nondecreasing order, exact output length, multiset element frequency preservation, and non-mutation of input.
export function verifySortProperties(sortFn) {
// Assert sortedness, multiset preservation, and input immutability.
}Need a hint?
- A function returning [] is technically sorted—length and multiset frequency checks kill that mutant.
- Snapshot [...input] before calling sortFn to catch in-place mutation bugs.
Saved on this device · 0 / 6000 · Do not include passwords or private data.
VERIFY
Acceptance checks
From the folder containing your downloaded files, run:
node checks.mjs ./starter.mjs 2This runs checks up to this step. Earlier steps must work first. Mark each result only after checking your implementation; the website does not run or grade it.
Record your attempt to enable the checklist and reference comparison.
Compare with the reference
Attempt the step first, then compare decisions and behavior. There can be more than one correct implementation.
EXPLAIN
Your interviewer asks
A broken sort returns an empty array and passes your sortedness check. What properties close that loophole?
Say your answer aloud, then record the trade-offs and evidence in your notes above.
LOCAL VOICE REHEARSAL
Rehearse your step walkthrough aloud
00:00/ 02:00