I went through a three-round virtual onsite interview with Affirm, consisting of a traditional coding round, an AI-assisted coding round, and a hiring manager interview. The first round involved aggregating merchant transaction amounts over the past 24 hours, while the AI coding round required debugging an existing full-stack learning platform and implementing a new API.
The AI coding round was particularly different from similar interviews I've had with other companies because the requirements were unusually detailed and came with complete tests. Unfortunately, I didn't pass the onsite, and I've already been searching for a job for quite some time.
The first round was a traditional coding interview involving a fairly unfamiliar problem with a surprisingly long description. It took some effort to understand all the requirements, but I didn't need to implement CSV parsing because the interviewer provided a test harness that already converted the input file into a list of dictionaries.
The problem involved transaction records containing the following fields:
user_id: The customer associated with the transaction.
merchant_id: The merchant receiving the transaction.
start_time: Transaction start timestamp.
end_time: Transaction end timestamp.
status: Transaction status, such as Completed or Failed.
amount: Transaction amount.
I was asked to implement a function that accepts a list of merchant IDs and calculates the total amount of completed transactions for each merchant, grouped by the number of hours ago they occurred. Only transactions within the last 24 hours should be included, and transactions that were not completed should be excluded.
The returned structure needed to map each merchant ID to another dictionary, where each key represented the number of hours ago and each value represented the total completed transaction amount for that hour.
Example — Hourly Transaction Aggregation
Suppose the current time is 2026-08-18T22:45:00, and the parsed transaction data looks like this: