NewThe Learning module is now liveSee what's new
avatar
User-9yxjiSep 22, 2026

Affirm phone screen, Live Fraud Detector writeup

Interview Experiences
affirm

Affirm phone screen, Live Fraud Detector writeup

Sharing this since other people's writeups on Affirm's phone screen really helped me prep, figured I'd add to the pile. Got the Live Fraud Detector problem, 60 minutes on codepad with full screen share required.

Part 1 is debugging a DistinctPIIValuesCounter class that's supposed to track distinct PII values, address, phone, email, ssn, seen across underwriting events. The starter code was missing a check that filters out non underwriting event types before counting, so it was double counting stuff it shouldn't have touched at all. Took a few minutes to spot since the bug wasn't in the obvious counting logic, it was upstream in the filter.

Part 2 builds on that, implementing a FraudDetector that flags suspicious underwriting events and then propagates any PII seen on a flagged event forward into a suspicious set so future events with matching PII also get flagged. Easy to miss that newly flagged events need to propagate their PII forward too, people tend to assume only the events already in the suspicious set matter.

No real algorithmic complexity once you get the propagation rule, it's mostly a hashmap and hashset problem, but reading the 100 plus lines of starter code carefully ate a good chunk of the hour. Finished with about 5 minutes left, waiting to hear back now.

20253.2k

Replies (3)

avatar
benhe118Sep 22, 2026

did you get the same DistinctPIIValuesCounter starter code or was it a different variant? trying to figure out how consistent this one is across candidates

112
avatar
emma.wilson82Sep 22, 2026

same starter code as far as I could tell, the DistinctPIIValuesCounter class name was identical to what I've seen mentioned elsewhere

96
avatar
User-m2wtmSep 22, 2026

affirm gave me a really similar problem a few months back, the propagation part is what got me too honestly

103
avatar
User-65h83Sep 23, 2026

yeah feels like there's only a handful of problems in rotation for this phone screen, seen this one come up a lot

114
avatar
rohanverma1125Sep 22, 2026

60 minutes for one problem is rough with that much starter code to read through, good writeup though

37