LEARN. PRACTICE. EXPLAIN.
Learning paths & interview practiceP
← Reverse engineer a binary packfile
BUILD → VERIFY → EXPLAIN · STEP 4 OF 6

Implement CRC32 integrity checks

Compute and verify the CRC32 checksum for each payload slice to detect data corruption.

UNDERSTAND

Bring these concepts with you

BUILD

Your implementation

  1. Implement an IEEE 802.3 256-entry CRC32 calculation table for fast byte processing.
  2. Compare the computed CRC32 unsigned 32-bit integer against the entry.crc value.
  3. Throw Error('Checksum mismatch') if the data does not match the stored checksum.
function verifyChecksum(data, expectedCrc) {
  // Compute CRC32 of data and compare with expected unsigned 32-bit int.
}
Need a hint?
  • Precomputing the CRC32 table with polynomial 0xEDB88320 makes computation linear in input length.
  • Ensure the comparison treats values as unsigned 32-bit integers using (crc >>> 0).

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 1 through 6 4

This 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

Why is CRC32 suitable for detecting accidental bit rot but inadequate for preventing deliberate tampering by an adversary?

Say your answer aloud, then record the trade-offs and evidence in your notes above.

LOCAL VOICE REHEARSAL

Rehearse your step walkthrough aloud

Target pacing: 02:00 · Stays in this browser only; never uploaded.

00:00/ 02:00
AlifBay Prep