KatInterview

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

Math & Bit Manipulation Interview Problems

Practice 5972 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.

5972
Problems
2212
Auto-graded
15
Topics
273
Added today

Showing 121–150 of 184 results

  • Math & Bit ManipulationMediumAuto-graded
    Minimize Expected Candidates with Position-Match Feedback

    Tests ability to model a greedy partitioning strategy using bitmask bucketing to minimize expected remaining candidates under green-only feedback.

    Math & Bit Manipulationgreedybitmaskhashing
  • Math & Bit ManipulationMediumAuto-graded
    32-Bit Integer Product via Shift-and-Add

    Tests mastery of bitwise arithmetic, sign handling, two's-complement overflow semantics, and O(log n) shift-and-add multiplication without using * or /.

    Math & Bit Manipulationbit-manipulationmathoverflowtwo's-complement
  • Math & Bit ManipulationMediumAuto-graded
    Tank Filling: Can You Hit an Exact Volume?

    Tests whether a candidate can apply GCD-based number theory and state-space reasoning to determine if a target volume is reachable with two containers.

    Math & Bit Manipulationmathbfsnumber-theory
  • Math & Bit ManipulationEasyAuto-graded
    Compute Tax Using Marginal Brackets

    Tests understanding of piecewise rate application and interval-based accumulation in a tiered tax system.

    Math & Bit Manipulationsimulationmathiteration
  • Math & Bit ManipulationMediumAuto-graded
    Two-Year Show Profit: Renewal vs. New Launch

    Compute two-year profits for two show options, blend the new show's outcomes by success probability, and find the break-even probability.

    Math & Bit Manipulationarithmeticexpected-valuebreak-evenbusiness-math
  • Math & Bit ManipulationMediumAuto-graded
    Fewest Steps to Reach One

    Tests greedy reasoning over binary structure to find the minimum number of halving and increment/decrement steps needed to reduce a positive integer to 1.

    Math & Bit Manipulationgreedybit-manipulationmath
  • Math & Bit ManipulationHardAuto-graded
    Decompose an IP Range into the Fewest CIDR Blocks

    Tests greedy interval tiling and bit manipulation by converting an inclusive IPv4 address range into the minimum list of valid, aligned CIDR blocks.

    Math & Bit Manipulationbit-manipulationgreedynetworking
  • Math & Bit ManipulationMediumAuto-graded
    Frequency Peaks and Prime Extraction

    Tests frequency counting with tie-aware mode detection and prime identification via sieve, including edge cases for unique values and non-prime inputs.

    Math & Bit Manipulationhash-mapsieve-of-eratosthenesfrequency-counting
  • Math & Bit ManipulationMediumAuto-graded
    Decode a Mixed-Radix Positional Number

    Tests the ability to convert a number represented in a variable base-per-digit (mixed-radix) system back to its standard base-10 integer value.

    Math & Bit Manipulationmathbase conversionnumber theory
  • Math & Bit ManipulationEasyAuto-graded
    Four Colleagues in a Row: Recover the Exact Standing Order

    Tests constraint satisfaction and logical deduction by finding the unique left-to-right arrangement of four people from four positional clues.

    Math & Bit Manipulationlogicconstraint-satisfactionbrute-forcepermutations
  • Math & Bit ManipulationMediumAuto-graded
    Overflow-Safe Power with a Custom Modular Multiplier

    Tests whether a candidate can build exponentiation from scratch using only 64-bit-safe addition and multiplication under an arbitrary modulus.

    Math & Bit Manipulationmodular arithmeticbit manipulationexponentiation by squaring
  • Math & Bit ManipulationMediumAuto-graded
    Four Numbers, One Target: Arithmetic Reachability

    Tests combinatorial search over arithmetic expressions, exact rational arithmetic, and division-by-zero handling to decide if four numbers can combine to a target.

    Math & Bit Manipulationbacktrackingrecursionmath
  • Math & Bit ManipulationEasyAuto-graded
    Steady-State Junction Temperature With and Without Heatsink

    Compute a component's junction temperature from power dissipation and series thermal resistances, both before and after adding a heatsink.

    Math & Bit Manipulationthermal-modelingarithmeticembedded-systemssteady-state
  • Math & Bit ManipulationEasyAuto-graded
    Truth-Tellers and Liars: Deduce Two Island Identities

    Tests systematic logical deduction by resolving a two-person truth-teller/liar puzzle through exhaustive case analysis.

    Math & Bit Manipulationlogiccase-analysismath
  • Math & Bit ManipulationMediumAuto-graded
    Reroll Game Expected Value and Break-Even Cost

    Tests probability recursion, expected value with random stopping times, and cost-benefit analysis in a sequential game.

    Math & Bit Manipulationprobabilityexpected-valuerecursion
  • Math & Bit ManipulationMediumAuto-graded
    Optimal Ball Distribution for Maximum Joint Red Probability

    Tests ability to formulate and optimize a probability function over discrete allocations with boundary analysis.

    Math & Bit Manipulationprobabilityoptimizationmath
  • Math & Bit ManipulationEasyAuto-graded
    Calculate QR Campaign Funnel Metrics

    Tests understanding of multi-stage conversion funnels by computing metrics at each step given input rates.

    Math & Bit Manipulationmathfunnel-analysisconversions
  • Math & Bit ManipulationHardAuto-graded
    Compute Complexity Bounds for Dense Matrix Operations

    Tests asymptotic analysis skills by deriving time and space complexity for dense matrix multiplication with multiple dimensions.

    Math & Bit Manipulationcomplexity-analysislinear-algebrabig-o
  • Math & Bit ManipulationMediumAuto-graded
    Balance Integer Values to Minimize Spread

    Tests understanding of integer division, remainder distribution, and handling negative numbers in a fairness optimization problem.

    Math & Bit Manipulationmathgreedydivisionedge-cases
  • Math & Bit ManipulationMediumAuto-graded
    Count Subsequences With Uniform Letter Frequency

    Tests combinatorics, modular arithmetic, and frequency grouping by counting index-distinct subsequences where every included letter appears the same number of times.

    Math & Bit Manipulationcombinatoricsmodular arithmeticfrequency counting
  • Math & Bit ManipulationMediumAuto-graded
    Longest Non-Overlapping Character Chain

    Tests backtracking or bitmask optimization to select a subset of strings whose combined characters are all distinct.

    Math & Bit Manipulationbacktrackingbit-manipulationrecursion
  • Math & Bit ManipulationMediumAuto-graded
    Observer Simulation and Manual Integer Conversion

    Tests event-driven simulation optimization and precise numeric string formatting including signed 32-bit boundary handling.

    Math & Bit Manipulationsimulationmathstring-manipulation
  • Math & Bit ManipulationMediumAuto-graded
    Count Days Between Two Dates

    Tests efficient calendar arithmetic by computing date intervals without iteration, requiring leap year logic and modular reasoning.

    Math & Bit Manipulationmathcalendarmodular-arithmetic
  • Math & Bit ManipulationMediumAuto-graded
    Calculate Day Count Between Two Dates

    Tests understanding of calendar arithmetic including leap year logic, month lengths, and converting dates to a numeric representation.

    Math & Bit Manipulationmathimplementationdate-arithmetic
  • Math & Bit ManipulationEasyAuto-graded
    Calculate Population Variance Using Welford's Method

    Tests ability to implement numerically stable variance computation with single-pass streaming aggregation and handling of floating-point precision issues.

    Math & Bit Manipulationmathstatisticsnumerical-stabilitystreaming
  • Math & Bit ManipulationHardAuto-graded
    Splitting Tokens: Will a Bucket Ever Run Dry?

    Tests whether a candidate can identify a modular-arithmetic invariant to avoid simulating an exponentially long process.

    Math & Bit Manipulationmathbit-manipulationnumber-theory
  • Math & Bit ManipulationMediumAuto-graded
    Parse Mixed-Endian Binary Protocol Fields

    Tests byte-level manipulation to extract little-endian and big-endian integers from a raw byte buffer without relying on architecture-specific memory layout.

    Math & Bit Manipulationbit-manipulationbytesendianness
  • Math & Bit ManipulationMediumAuto-graded
    Match IP Address to Network Block

    Tests bitwise operations on IPv4 addresses, CIDR prefix matching, and linear search with early termination.

    Math & Bit Manipulationbit-manipulationipv4networkinglinear-search
  • Math & Bit ManipulationMediumAuto-graded
    Calculate Emergency Braking Distance and Decision

    Tests understanding of kinematic equations, motion physics, and numerical reasoning to determine whether a vehicle can stop in time given speed, obstacle distance, deceleration, and reaction delay.

    Math & Bit Manipulationphysicskinematicsnumerical-reasoning
  • Math & Bit ManipulationMediumAuto-graded
    Residue Distribution of Dice Sums and 2×2 Stochastic Determinants

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

    Math & Bit Manipulationprobabilitylinear-algebramodular-arithmetic