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 181–210 of 217 results

  • Tests whether a candidate can compute modular probability distributions over two-dice outcomes and derive the determinant formula for a constrained matrix class.

    Auto-gradedprobabilitylinear-algebramodular-arithmetic
  • Tests cost-volume-profit analysis by computing last period's profit and the sales volume needed to maintain that profit when fixed costs rise.

    Auto-gradedmathbusiness-logicformulas
  • Tests systematic application of balance constraints in a multi-level mobile where equal-arm bars divide weight evenly.

    Auto-gradedalgebrarecursionmathlogic
  • Tests understanding of modular arithmetic by computing the digital root of a large integer without repeatedly summing digits in a loop.

    Auto-gradedmathmodular arithmeticnumber theory
  • Tests understanding of base conversion by summing digits of a number across every base from 2 to b and checking whether each base yields a digit sum equal to a target value.

    Auto-gradedmathbit manipulationbase conversion
  • Tests understanding of binomial distributions and computing cumulative probabilities for discrete independent events.

    Auto-gradedprobabilitybinomial-distributioncombinatorics
  • Finding a specific value in a spiral-filled matrix using mathematical properties of concentric rings rather than simulation.

    Auto-gradedmatrixspiralmathclosed-form
  • Tests piecewise optimization and depot strategy when a vehicle with limited capacity must transport goods while consuming resources proportional to distance traveled.

    Auto-gradedoptimizationmathgreedysimulation
  • Transform a portfolio optimization model with absolute-value transaction costs into standard linear programming form using auxiliary variables.

    Auto-gradedlinear-programmingoptimizationmathematical-modeling
  • Determine whether two circles intersect at two points, are tangent at one point, or have no boundary contact.

    Model answergeometrydistanceedge-casesnumerical-stability
  • Tests setting up and solving a system of linear equations with fixed ratios between variables.

    Auto-gradedalgebralinear-equationsconstraint-satisfaction
  • Evaluates efficient character set representation using bit manipulation and frequency-based combinatorial counting.

    Auto-gradedbit-manipulationarraysstringshashing
  • Tests understanding of geometric probability, the inspection paradox, and computing expectations when a random partition is observed from a fixed viewpoint.

    Auto-gradedprobabilitygeometryexpectationinspection-paradox
  • Create a utility to parse, compute offsets, and analyze CIDR blocks for IPv4 and IPv6 addresses using integer arithmetic, no networking libraries allowed.

    Model answerbit-manipulationparsingnetworkinginteger-arithmetic
  • Tests whether a candidate can reduce a unit-fraction equation to a divisor-counting problem using algebraic factoring and number theory.

    Auto-gradednumber-theorydivisorsprime-factorization
  • Tests understanding of number theory and optimal algorithms for decomposing integers into sums of perfect squares.

    Auto-gradednumber-theorymathoptimization
  • Tests ability to use bit manipulation and counting to find the largest group of numbers sharing at least one common bit.

    Auto-gradedbit-manipulationgreedycounting
  • Tests combinatorics by counting monotone lattice paths from (0,0) to (m,n) that avoid a given set of forbidden grid cells, using inclusion-exclusion over path prefixes.

    Auto-gradedcombinatoricsdynamic programmingmathbit manipulation
  • Tests break-even analysis, contribution margin calculations, capacity constraints, and financial comparison of energy generation alternatives.

    Auto-gradedbreak-even analysisprofit calculationbusiness metrics
  • Simulating an iterative number transformation until a fixed point is reached, handling boundary conditions and large intermediate values.

    Auto-gradedsimulationiterationmathematical-sequences
  • Tests bitmask-based interval availability checking for constrained seat allocation with large input optimization.

    Auto-gradedbitmaskgreedyoptimization
  • Tests unit economics, capacity planning, and dynamic pricing calculations for a transportation service with fixed driver costs and variable demand.

    Auto-gradedunit-economicscapacity-planningprofit-calculation
  • Tests understanding of LCM computation via repeated GCD to find the least positive integer divisible by every integer in a given range.

    Auto-gradedmathnumber-theorygcd-lcm
  • Tests the ability to combine bit counting (popcount) with efficient pair enumeration to find pairs in an array whose XOR contains exactly K set bits.

    Auto-gradedbit manipulationnumber theorycombinatorics
  • Tests whether candidates can combine combinatorics (counting subsets) with the insight that a product is a power of two iff every element is itself a power of two.

    Auto-gradedcombinatoricsbit manipulationmath
  • Tests Markov chain modeling, symmetry reduction, and first-step recurrence equations for a two-particle random walk problem.

    Auto-gradedprobabilitymarkov-chainsrandom-walksexpected-value
  • Tests the ability to apply LCM iteratively and use GCD to reduce it, while reasoning about arithmetic progressions and large-number arithmetic.

    Auto-gradedmathnumber-theorygcd-lcm
  • Tests whether a candidate can combine combinatorics (binomial coefficients) to count grid paths that must pass through a sequence of ordered checkpoints.

    Auto-gradedcombinatoricsmathdynamic programming
  • Tests ability to repeatedly convert an integer into multiple bases and accumulate digit sums, combining base-conversion mechanics with modular arithmetic.

    Auto-gradedmathbit manipulationbase conversion
  • Tests logical reasoning about burn-time budgets and how lighting both ends of a cord precisely halves its remaining duration regardless of density.

    Auto-gradedlogicreasoningmath

More topics