Software Engineer • Mid-Level
Software Engineer • Mid-Level
High QualityPrep Other Coding Questions Asked by Affirm
Continue with targeted prep from Affirm's coding question bank.
Interview Summary
The interview consisted of two connected problems: identifying users who met specific activity requirements across two days, and evaluating the trustworthiness of a new purchase based on historical transaction behavior.
The second part built directly on the first, introducing transaction history analysis, scoring rules, and amount-based penalties. The follow-ups explored streaming data processing, production readiness, and handling extremely large log datasets. Overall, the difficulty was moderate, but the lengthy problem description and multiple requirements made time management important.
Interview Details
Part 1 — Find Users with Activity Across Multiple Days
The first problem involved analyzing transaction logs collected over two different days. Each log file contained records with four fields: <date, userId, orderType, amount>. The fields represented:
date: The date of the transaction.userId: The identifier of the user who placed the order.orderType: The channel through which the order was placed, such as phone, web, or app.amount: The monetary value of the transaction.
Problem Requirements
Given two log files representing different days, identify all users who satisfy both conditions:
- The user must have at least one transaction recorded on each of the two days.
- Across their transactions, the user must have used at least two distinct order types.
The function should return the list of qualifying user IDs. For example, a user who placed orders through both the mobile app and the website on separate days would meet the order-type diversity requirement. However, a user who appeared on both days but only used the same order type would not qualify. Similarly, a user who used several order types but appeared on only one day would not qualify.
Part 2 — Calculate a Trust Score for a New Purchase
The second part extended the transaction processing system. Given a new purchase containing a userId, orderType, and amount, calculate a trust
Unlock Full Details
Create a free account to unlock this interview experience report.