Make an Audit Evidence Log Tamper Evident With Hash Chaining

Last updated: November 29, 2026

Quick Overview

Implement an append-only log of audit workpaper events where each record is hash-chained to the previous one, plus a verifier that reports the first altered, reordered or missing record.

EY
Software Engineering Fundamentals
Software Engineer
EY
November 29, 2026
Software Engineer
Technical Screen
Software Engineering Fundamentals
Medium

0

0

0 solved


Implement an append-only log of audit workpaper events where each record is hash-chained to the previous one, plus a verifier that reports the first altered, reordered or missing record.

Audit platforms such as EY Canvas must show who changed what and when, and must make after-the-fact edits detectable once an archive is locked. The interviewer checks cryptographic hashing basics, canonical serialization and an honest view of what a hash chain does and does not protect against.

What the Interviewer Expects
  • Chain each record's hash over the previous hash plus a canonical payload
  • Use deterministic serialization so verification is reproducible
  • Verify sequence numbers and prev links, not just hashes
  • Explain why truncation needs an externally anchored head hash
  • Discuss keys, signatures or a ledger service for stronger guarantees
Key Topics to Cover
SHA-256
hash chains
canonical serialization
append-only logs
integrity verification
How to Approach This
  1. Apply SOLID principles. Single Responsibility makes code testable, Open/Closed makes it extensible.
  2. Choose data structures based on access patterns, not familiarity.
  3. Prefer immutable data and message passing over shared mutable state for concurrency.
  4. Design APIs with RESTful conventions, versioning, meaningful errors, and pagination from day one.
Possible Follow-up Questions
  • How would an attacker with write access defeat a plain hash chain, and how do signatures or anchoring help?
  • How would you verify a 100 million record log efficiently?
  • How would you support legally required deletion of personal data inside a chained log?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Requirements

append(log, payload) adds a record with seq, payload, prev and hash. first_bad_record(log, anchored_head) returns the first index that fails, len(log) if records were removed from the en...

High-Level Design

hash_i = SHA256(hash_{i-1} || canonical_json(payload_i)) with a fixed genesis value. Editing any payload changes its hash, which breaks the link stored in the next record. Periodically the current h...


Submit Your Answer
Markdown supported

Related Questions