← Schonfeld Interview Insights

Schonfeld·Data Scientist·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Got a math/combinatorics problem for a Data Scientist role at Schonfeld. Pretty pure puzzle, not much data science flavor to it, which threw me a bit.

Questions Asked (1)

Q1

Given two positive integers 5 and 21, find the smallest integer N such that every integer greater than or equal to N can be expressed as a non-negative integer linear combination of 5 and 21.

Algorithms & Data Structures
Author's notes

This is basically the Frobenius/coin problem.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Use the Frobenius coin problem result for two coprime integers a and b: the largest non-representable integer is ab - a - b, so the smallest N such that all integers ≥ N are representable is ab - a - b + 1. For a=5 and b=21, compute 5*21 - 5 - 21 + 1 = 80. Explain the reasoning and verify with a small example or modular argument.

Pro tip: Mention that this is a classic number theory result (Frobenius number) and that for two coprime numbers the formula is exact; for more than two numbers no simple closed form exists, which shows depth. Also, briefly verify that 79 is not representable (e.g., 79 = 21*3 + 16, and 16 cannot be made with 5s and 21s) to confirm N=80.

1. Identify the problem type

Recognize that this is the Frobenius coin problem for two coprime integers. State that since gcd(5,21)=1, all sufficiently large integers are representable.

2. Recall or derive the formula

For two coprime positive integers a and b, the largest non-representable integer is ab - a - b. Therefore the smallest N such that all integers ≥ N are representable is ab - a - b + 1.

3. Apply the formula

Plug in a=5, b=21: ab - a - b + 1 = 105 - 5 - 21 + 1 = 80. So N=80.

4. Verify with a quick check

Show that 79 is not representable (e.g., 79 = 21*3 + 16, and 16 cannot be formed by 5s and 21s) and that 80 is representable (80 = 5*16). This confirms the boundary.

5. Generalize and discuss implications

Mention that for more than two numbers, the Frobenius number is not known in closed form and is NP-hard to compute, which is relevant in algorithm design and data science contexts.

Key Points to Mention

  • Frobenius coin problem and its formula for two coprime integers: ab - a - b.
  • The condition gcd(a,b)=1 is necessary for all sufficiently large integers to be representable.
  • The smallest N is the Frobenius number plus 1.
  • Verification that 79 is not representable and 80 is representable.
  • The problem is related to the coin change problem and has applications in algorithm design.
  • For more than two numbers, the Frobenius number is NP-hard to compute, showing complexity.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.