Topic 2
Numbers & math
GCD, primes and modular thinking.
Many interview problems reduce to number properties: divisibility, remainders, primes and greatest common divisors. Prefer integer arithmetic, watch for overflow, and stop loops at the square root when searching for divisors.
Key patterns
- Euclid's algorithm for GCD
- Check divisors up to sqrt(n)
- Sieve of Eratosthenes
- Modular arithmetic to avoid overflow
Problems
0 / 49 solved