5 number theory interview questions, asked at Google, Airbnb, Amazon and 2 more companies. Last asked Jul 2026.
+1
Can repeated pair additions reach a target pointCodingFrom a starting point (x, y) you may move to (x + y, y) or (x, x + y). Decide whether a target point is reachable, efficiently even for very large coordinates.
Count pairs with 1/x + 1/y = 1/NCodingGiven a positive integer N up to about a million, count the ordered pairs of positive integers (x, y) with 1/x + 1/y = 1/N. Show that the count equals the number of divisors of…
Last asked Nov 2025
Numbers that are a sum of two squares in exactly two waysCodingFind the numbers up to a limit that can be written as a^2 + b^2 in exactly two different ways (unordered, with the agreed rule on zero). Enumerate pairs efficiently, count…
Last asked Oct 2025
Reachable sum with reusable values and a huge targetCodingGiven a non-empty list nums of positive integers and a target k, return true if some multiset of values from nums sums to exactly k, and false otherwise. You may use each value…