Problem database last updated: June 20, 2025

AAffirm logo

Affirm Coding Interview Questions

10 problems · 2 Easy, 6 Medium, 2 Hard · Ranked #146 of 458

Difficulty breakdown

2 Easy

20% · avg 23%

6 Medium

60% · avg 59%

2 Hard

20% · avg 18%

Top topics

hash-table
60%2.7x
string
60%2.1x
array
50%
design
30%5.2x
math
20%1.6x
randomized
20%21.5x

Interview profile

Based on 10 reported problems, Affirm interviews are in line with industry averages - 20% Hard vs 18% overall. The majority (60%) of questions are Medium difficulty, which is typical for companies that want to see solid fundamentals without excessive trick questions.

Compared to the industry average, Affirm puts unusual emphasis on randomized (20% of problems, 21.5x the industry average), design (30% of problems, 5.2x the industry average), hash-table (60% of problems, 2.7x the industry average). If you're short on time, these are the categories to double down on.

The most common topics are hash-table (60%), string (60%), array (50%), design (30%). Problems below are sorted by frequency, the ones at the top are asked most often.

All 10 problems

Insert Delete GetRandom O(1)

Solve

Implement the RandomizedSet class:

MediumVery Likely
arrayhash-tablemath

Shortest Uncommon Substring in an Array

Solve

You are given an array arr of size n consisting of non-empty strings.

MediumVery Likely
arrayhash-tablestring

Group Anagrams

Solve

Given an array of strings strs, group the anagrams together. You can return the answer in any order.

MediumVery Likely
arrayhash-tablestring

Parse Lisp Expression

Solve

You are given a string expression representing a Lisp-like expression to return the integer value of.

HardLikely
hash-tablestringstack

Insert Delete GetRandom O(1) - Duplicates allowed

Solve

RandomizedCollection is a data structure that contains a collection of numbers, possibly duplicates (i.e., a multiset). It should support inserting and removing...

HardLikely
arrayhash-tablemath

String Compression

Solve

Given an array of characters chars, compress it using the following algorithm:

MediumLikely
two-pointersstring

Valid Anagram

Solve

Given two strings s and t, return true if t is an anagram of s, and false otherwise.

EasyLikely
hash-tablestringsorting

Coin Change

Solve

You are given an integer array coins representing coins of different denominations and an integer amount representing a total amount of money.

MediumLikely
arraydynamic-programmingbreadth-first-search

String Compression III

Solve

Given a string word, compress it using the following algorithm:

MediumSometimes
string

Number of Recent Calls

Solve

You have a RecentCounter class which counts the number of recent requests within a certain time frame.

EasySometimes
designqueuedata-stream

How often are these problems asked?

Frequency scores are based on crowdsourced interview reports. A higher score means the problem has been reported more often in recent Affirm interviews.

Very Likely

75-100%

Likely

50-74%

Sometimes

25-49%

Rare

0-24%

Preparing for your Affirm coding interview

Affirm interviews focus heavily on hash-table, string, array problems. If you're short on time, these are the categories to prioritize. The problems on this page are sorted by frequency, so start from the top and work your way down.

Beyond solving problems, practice explaining your approach. Affirm interviewers care about your thought process - how you break down a problem, consider edge cases, and evaluate tradeoffs between solutions. A clean O(n) solution you can explain clearly beats an O(log n) solution you can't articulate.

Looking for more companies? Browse all 458 companies in our directory, or sharpen your fundamentals with our free data structure visualizers and AI-powered DSA tutor.

Frequently Asked Questions

What coding problems does Affirm ask in interviews?add

Affirm has been reported to ask 10 distinct coding problems. The most common topics are hash-table, string, array. 2 are Easy difficulty, 6 are Medium, and 2 are Hard. Problems are sorted by frequency - the ones at the top are asked most often.

How hard are Affirm coding interviews?add

Based on 10 reported problems, Affirm interviews are in line with industry averages - 20% Hard vs 18% overall. 60% of questions are Medium difficulty. Focus on the high-frequency Medium problems first, then work through the Hard ones.

How should I prepare for a Affirm coding interview?add

Start with the highest-frequency problems listed on this page. Focus on the core topics: hash-table, string, array. Practice solving them under time pressure and explaining your approach out loud. Mock interviews with AI can simulate the real experience.

Other companies to explore

Ready to ace your Affirm interview?

Simulate a real Affirm coding interview with an AI interviewer. Get a scorecard with specific feedback on your problem-solving, code quality, and communication.

Simulate a Affirm interview with AIarrow_forward