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

Extract entry payloads from data slices

Slice the raw binary bytes for each entry and return them as isolated buffers.

UNDERSTAND

Bring these concepts with you

BUILD

Your implementation

  1. Given an entry record, slice the target byte region from the archive buffer.
  2. Ensure the returned slice has the exact byte length specified in entry.size.
  3. Expose an extractEntry(buffer, entries, name) helper that returns the buffer for a named file or throws if missing.
function extractEntry(buffer, entries, name) {
  // Locate entry by name, slice buffer at entry.offset with entry.size.
}
Need a hint?
  • Use buffer.subarray(entry.offset, entry.offset + entry.size) to access the slice.
  • Wrap with Buffer.from(slice) to create an independent memory copy.

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 3

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

What is the performance and memory trade-off between zero-copy buffer views and copying memory slices?

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