Strings and Nested Data
Affirm's string questions fit on one screen. The three here cover substrings, a two-way encoding, and records with nested fields.
The methods are standard: a counting map, two pointers, and a recursive walk over nested keys. Where people slip is the edges, since every prompt leaves a few undefined.
Pin the output format before you write the loop. Small choices change the answer on all three. Does a tie go to the earliest start or to the first in alphabetical order? Can a count go past 9? How do you type a list that holds both ints and strings? Write a test for every answer you get, then build.
AffirmPremium lesson · Coding round
The 3 Affirm problems are below.
- A Premium questionCoding · Medium · Frequently asked
- A Premium questionCoding · Easy · Frequently asked
- A Premium questionCoding · Medium
Each with hints, the follow-up and a tested solution.
Get the Affirm questions$49 a year · all 100 companies · cancel anytime
From 20,000+ candidate reports, forum threads behind logins and write-ups in Chinese.
Had your Affirm interview?Tell us what they asked. Reviewed before it goes in, never with your name.
Affirm interview guideKnow what Affirm asks before you walk in.
24 coding · 2 system design · 13 behavioral questions
Get Premium$49 a year · Cancel anytime
Or start freeNo card.
Get their questions first.
InterviewLegend is independent and not affiliated with or endorsed by any company it covers.