Question Details
Problem Given a list of purchase events for a single user, each as (item_id, timestamp), determine the most frequent consecutive purchase pattern of length k. A pattern is a sequence of exactly k distinct items bought in consecutive transactions (no gaps). Return the pattern as a list of item IDs in the order they were purchased. If there is a tie, return the lexicographically smallest sequence. Example: Constraints: 1 <= k <= len(purchases), timestamps are strictly increasing. Follow-ups How do…
Full Details
🔒
Unlock all Affirm questions
Full insider details, leaked discussions, and candidate experiences.
Get full access — $100 a year, unlimited accessAbout This Question
This is a reported interview question from a affirm interview during the phone round.
More Affirm Interview Questions
1p3a
affirm fulltime software engineer tech phone screen interview overview
InterviewDB
Card Game - OOD Deck, Hand, and Turn-Based Game Engine
1p3a
Affirm Full-Time Tech Phone Screen Interview Experience
InterviewDB
Decision Tree - Implement Predict Traversal for a Binary Classification Tree
InterviewDB
Dispute Status - State Machine for Payment Dispute Lifecycle