KatInterview

practice a little every day — you've got this ♡

Math & Bit Manipulation Interview Problems

Practice 5971 original coding, SQL, system design, machine learning and behavioral problems across 15 topics. Coding and SQL problems run against hidden test cases right in your browser; every problem has hints and a worked solution, free.

5971
Problems
2211
Auto-graded
15
Topics
272
Added today

Showing 151–180 of 184 results

  • Math & Bit ManipulationEasyAuto-graded
    Unit Sales Target After Fixed Cost Increase

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

    Math & Bit Manipulationmathbusiness-logicformulas
  • Math & Bit ManipulationEasyAuto-graded
    Calculate Weight in a Nested Balanced Mobile System

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

    Math & Bit Manipulationalgebrarecursionmathlogic
  • Math & Bit ManipulationEasyAuto-graded
    Digital Root via Modular Arithmetic

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

    Math & Bit Manipulationmathmodular arithmeticnumber theory
  • Math & Bit ManipulationMediumAuto-graded
    Balanced Digit Sum Across All Bases

    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.

    Math & Bit Manipulationmathbit manipulationbase conversion
  • Math & Bit ManipulationEasyAuto-graded
    Calculate Binomial Cumulative Probability for Limited Supply

    Tests understanding of binomial distributions and computing cumulative probabilities for discrete independent events.

    Math & Bit Manipulationprobabilitybinomial-distributioncombinatorics
  • Math & Bit ManipulationMediumAuto-graded
    Anti-Diagonal Cell in Outward Spiral Matrix

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

    Math & Bit Manipulationmatrixspiralmathclosed-form
  • Math & Bit ManipulationMediumAuto-graded
    Desert Transport: Maximum Cargo Delivery with Consumption Cost

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

    Math & Bit Manipulationoptimizationmathgreedysimulation
  • Math & Bit ManipulationMediumAuto-graded
    Convert Absolute-Value Penalty to Linear Program Constraints

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

    Math & Bit Manipulationlinear-programmingoptimizationmathematical-modeling
  • Math & Bit ManipulationEasyAuto-graded
    Count Animals from Legs and Population Ratios

    Tests setting up and solving a system of linear equations with fixed ratios between variables.

    Math & Bit Manipulationalgebralinear-equationsconstraint-satisfaction
  • Math & Bit ManipulationMediumAuto-graded
    Find Non-Overlapping String Pairs by Letter Sets

    Evaluates efficient character set representation using bit manipulation and frequency-based combinatorial counting.

    Math & Bit Manipulationbit-manipulationarraysstringshashing
  • Math & Bit ManipulationEasyAuto-graded
    Average Arc Length Containing a Fixed Point on a Circle

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

    Math & Bit Manipulationprobabilitygeometryexpectationinspection-paradox
  • Math & Bit ManipulationMediumAuto-graded
    Positive Divisors of N² via Prime Factorization of N

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

    Math & Bit Manipulationnumber-theorydivisorsprime-factorization
  • Math & Bit ManipulationHardAuto-graded
    Minimum Perfect Squares to Sum to Target

    Tests understanding of number theory and optimal algorithms for decomposing integers into sums of perfect squares.

    Math & Bit Manipulationnumber-theorymathoptimization
  • Math & Bit ManipulationEasyAuto-graded
    Maximum Group Size with Shared Bit Position

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

    Math & Bit Manipulationbit-manipulationgreedycounting
  • Math & Bit ManipulationHardAuto-graded
    Count Lattice Paths Avoiding Forbidden Cells

    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.

    Math & Bit Manipulationcombinatoricsdynamic programmingmathbit manipulation
  • Math & Bit ManipulationMediumAuto-graded
    Calculate Power Plant Economics and Renewable Breakeven

    Tests break-even analysis, contribution margin calculations, capacity constraints, and financial comparison of energy generation alternatives.

    Math & Bit Manipulationbreak-even analysisprofit calculationbusiness metrics
  • Math & Bit ManipulationEasyAuto-graded
    Build the Hailstone Number Chain

    Simulating an iterative number transformation until a fixed point is reached, handling boundary conditions and large intermediate values.

    Math & Bit Manipulationsimulationiterationmathematical-sequences
  • Math & Bit ManipulationMediumAuto-graded
    Maximum Theater Group Seating Capacity

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

    Math & Bit Manipulationbitmaskgreedyoptimization
  • Math & Bit ManipulationMediumAuto-graded
    Calculate Ride Service Economics and Peak Pricing

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

    Math & Bit Manipulationunit-economicscapacity-planningprofit-calculation
  • Math & Bit ManipulationEasyAuto-graded
    Smallest Integer Divisible by All in Range

    Tests understanding of LCM computation via repeated GCD to find the least positive integer divisible by every integer in a given range.

    Math & Bit Manipulationmathnumber-theorygcd-lcm
  • Math & Bit ManipulationMediumAuto-graded
    Count Pairs Whose XOR Has Exactly K Set Bits

    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.

    Math & Bit Manipulationbit manipulationnumber theorycombinatorics
  • Math & Bit ManipulationEasyAuto-graded
    Count Subsets With Product Equal to a Power of Two

    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.

    Math & Bit Manipulationcombinatoricsbit manipulationmath
  • Math & Bit ManipulationMediumAuto-graded
    Expected Flips for Random Walkers to Collide on Octagon

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

    Math & Bit Manipulationprobabilitymarkov-chainsrandom-walksexpected-value
  • Math & Bit ManipulationMediumAuto-graded
    Smallest Integer Divisible by All Segment Lengths

    Tests the ability to apply LCM iteratively and use GCD to reduce it, while reasoning about arithmetic progressions and large-number arithmetic.

    Math & Bit Manipulationmathnumber-theorygcd-lcm
  • Math & Bit ManipulationMediumAuto-graded
    Count Lattice Paths Through Required Checkpoints

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

    Math & Bit Manipulationcombinatoricsmathdynamic programming
  • Math & Bit ManipulationMediumAuto-graded
    Sum of Digits Across All Bases from 2 to K

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

    Math & Bit Manipulationmathbit manipulationbase conversion
  • Math & Bit ManipulationMediumAuto-graded
    Time 45 Minutes Using Two Non-Uniform Burning Cords

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

    Math & Bit Manipulationlogicreasoningmath
  • Math & Bit ManipulationHardAuto-graded
    Minimum LCM Spanning Value of a Sequence

    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.

    Math & Bit Manipulationmathgcd/lcmnumber theory
  • Math & Bit ManipulationHardAuto-graded
    Balanced-Radix Digital Root Collision Finder

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

    Math & Bit Manipulationmathbit manipulationbase conversionnumber theory
  • Math & Bit ManipulationMediumAuto-graded
    Smallest Integer Divisible by All Values in Every Subarray of Length K

    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.

    Math & Bit Manipulationmathgcd/lcmsliding window