Skip to the page

Data pipelines in production · senior

PII in the lake and erasing a customer's data

Personal data in a lake must be found, locked down, masked and truly deleted, including old table versions. Contain a leak without destroying evidence and let security and legal decide on reporting.

The notes

What you must know

  • PII found in a raw bucket: remove read access at once (a bucket policy that denies all but a break-glass role), confirm it is not public, stop the nightly copy. Do not delete yet: security and legal need the evidence.
  • Investigate who read it (CloudTrail data events, access logs), every downstream copy (bronze, notebooks, exports, BI extracts) and how many people are affected. Escalate to security, the CISO and the data protection officer or legal. They decide on reporting. Do not paste sample data in chat.
  • Clean copies: delete or mask in lake tables and remove for real (DELETE, then VACUUM or snapshot expiry, because time travel keeps old files), and remove notebook exports.
  • Store KYC data properly: full Aadhaar numbers only in an encrypted vault, masked (last 4 digits) elsewhere, PAN and phone tokenised, tight key policies, column-level masking in the catalog and retention rules.
  • Find the next one: automated PII scanning (for example Amazon Macie), PII tags in the catalog, access reviews and alerts on wide grants.
  • Erasure: find data through catalog PII tags and lineage, and also free-text columns. A Delta DELETE with deletion vectors only marks rows; purge with REORG TABLE ... APPLY (PURGE), then VACUUM after the retention period. Iceberg: delete, rewrite, then expire snapshots and remove orphan files.
  • Raw Parquet dumps: batch requests (for example weekly) and rewrite only files that contain the person. Better design: keep PII in a vault keyed by a token, or encrypt per customer and delete the key (crypto-shredding).
  • Kafka data ages out with retention, and a compacted topic takes a tombstone for the key. Backups expire on their schedule and are never restored without re-applying the deletions, using a list of erased ids (hashed).
  • Keep proof: a log of what was deleted, where and when, and a verification query. Legal may require some records to be kept; legal decides and engineering keeps them apart and locked down.

The red pen

Common traps: mistake → fix

  • Mistake: Delete the bucket straight away

    Fix: that destroys evidence; contain first.

  • Mistake: DELETE ran, so the data is gone

    Fix: old versions and files remain until purge and VACUUM.

  • Mistake: Rewrite three years of files for every request

    Fix: batch, or design with tokens or per-customer keys.

Easy to hard

Questions interviewers ask, easy to hard

  1. You find KYC data in plain CSV in a raw bucket. What do you do?
  2. How do you erase one customer's data from a Delta lake?
  3. What is crypto-shredding?
  4. How do backups and Kafka fit into an erasure request?

Explain it out loud

Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.

Practise by voice

Your first interview is free

Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.

Start your free interview