LEARN. PRACTICE. EXPLAIN.
Learning paths & interview practiceP
← Build a health-probe & rollout controller
BUILD → VERIFY → EXPLAIN · STEP 5 OF 6

Sanitize logs and route actionable alerts

Scrub credentials before emitting logs and separate pages from tickets.

UNDERSTAND

Bring these concepts with you

BUILD

Your implementation

  1. Implement sanitizeAndClassifyLog(event) returning { redacted, route, reason } without mutating event.
  2. Recursively redact secret keys (authorization, token, password, apiKey, cookie) and Bearer substrings.
  3. Route user-facing error/high-burn events to 'page', other warnings/errors to 'ticket', and info to 'dashboard'.
export function sanitizeAndClassifyLog(event) {
  // Deep-redact secrets and classify alert route.
}
Need a hint?
  • Always return a new object so callers retain their internal values if needed without mutating fixtures.
  • Use an explicit regex for Bearer token strings inside message fields too.

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 5

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 difference between redacting tokens in the log viewer versus before the logging sink?

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