KatInterview

Topic

Math & Bit Manipulation interview problems

Number theory, combinatorics and bit tricks. 217 original problems, each with hidden test cases you can run in the browser.

Problems217

84 easy112 medium21 hard

Showing 211–217 of 217 results

  • Tests deep understanding of GCD/LCM relationships by finding the smallest integer ≥ 1 that, when inserted into an array, minimises the LCM of the entire resulting sequence.

    Auto-gradedmathgcd/lcmnumber theory
  • Tests mastery of base conversion and number theory by finding all integers in a range whose digital roots are identical across two different bases.

    Auto-gradedmathbit manipulationbase conversionnumber theory
  • Tests the ability to combine sliding-window enumeration with LCM/GCD reasoning to find the minimum positive integer that is simultaneously divisible by every contiguous subarray LCM.

    Auto-gradedmathgcd/lcmsliding window
  • Tests mastery of modular arithmetic by computing a power tower (iterated exponentiation) modulo M using Euler's theorem and recursive modular exponentiation.

    Auto-gradedmathmodular arithmeticnumber theory
  • Tests deep combinatorics knowledge by counting permutations of 1..n that have exactly k inversions, using the Mahonian distribution and efficient DP with modular arithmetic.

    Auto-gradedcombinatoricsdynamic programmingnumber theory
  • Tests the ability to evaluate a polynomial modulo a prime, raise the result to a large power modulo the same prime, and apply Fermat's little theorem for efficiency.

    Auto-gradedmathmodular arithmeticnumber theory
  • Tests combinatorial counting of grid paths using inclusion-exclusion and binomial coefficients, requiring precise arithmetic on a bounded lattice.

    Auto-gradedcombinatoricsmathdynamic programming

More topics