Skip to main content
Intermediatecoding Verified

How would you redact (blur) credit card numbers from application logs?

ReportedSource: interviewing.io: Stripe interview questions guide

Quick answerFree

Don't log card data (structured allowlisted logging, tokens/last 4). As a safety net, regex 13-19 digit runs, confirm with Luhn, mask all but last four, inside the logger before shipping; alert when it fires.

Detailed answer· ~130 words

Interview Prep

Unlock the full answer with Interview Prep

Get a ~130-word model answer and a runnable reference solution, plus 233 more Python questions.

Also in Pro (₹499 / 90 days).

Reference solution· runs in the browser sandbox

Interview Prep
Unlock with Interview Prep

+ 233 more Python questions in Interview Prep, each with the full answer.

Discussion