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.
84 easy112 medium21 hard
Showing 61–90 of 217 results
Enumerate all 216 outcomes of three dice to compute the mean, modes, prime probability and median of their product, and return a fixed risk note.
Auto-gradedenumerationprobabilitycountingstatisticsRestrict a 3x3 survey table to one column and return an exact reduced fraction for a conditional probability.
Auto-gradedprobabilityfractionstablesgcdConvert a list of real scores into a probability distribution via exponentiation and normalization, without overflow or division-by-zero for extreme input values.
Auto-gradednumerical-stabilitymathfloating-pointarraysTests the double-counting insight that each item appears in a fixed number of pair sums, so the total equals the sum of the readings divided by a constant.
Auto-gradedmathcountingpairwise-sumsarithmeticCompute the probability that two items from one group both beat two items from another group when all four scores are i.i.d. and continuous, using a symmetry and ranking-count argument.
Auto-gradedprobabilitycombinatoricssymmetrybrainteaserCount integers from 100 up to a given limit whose three digits are all different, using direct enumeration or combinatorial reasoning.
Auto-gradedmathenumerationdigitscountingSimulate several disc-shaped agents with forward Euler unicycle motion and report the first time step at which any pair overlaps, with all pairs at that step.
Auto-gradedsimulationgeometryfloating-pointpairsSolve five short arithmetic and algebra puzzles (units, compounding percentages, linear system, rate, series scaling) and return them in an exact string format.
Auto-gradedmatharithmeticalgebraunit-conversionCompute the square root of a non-negative number without a built-in root function and return it rounded to one decimal place, using bisection or Newton's method.
Auto-gradedbinary-searchnumerical-methodsfloating-pointmathComputes all valid integer dimensions for the intersection of two vector subspaces given ambient and subspace dimensions.
Auto-gradedmathlinear-algebraResolve an IPv4 address against CIDR allow/deny rules using longest-prefix precedence, later-rule tie-breaking, and a default of deny, via bitmask matching.
Auto-gradedbit-manipulationcidripv4simulationProduce all positive factors of an integer up to 10^12 in increasing order, handling perfect squares and large primes, and consider approaches faster than a square-root scan.
Auto-gradednumber-theorydivisorsfactorizationsquare-rootDecide whether two array-processing routines behave identically under 32-bit integer rules, find a smallest counterexample if not, and design tests that expose subtle divergences.
Model answerprogram-equivalenceinteger-overflowproperty-based-testingdifferential-testingOne islander accuses the other of always lying. Test all four role pairings and decide which ones are logically possible.
Model answerlogicpuzzlecase-analysisknights-and-knavesCount outcomes of a two-dice contest where ties favor the house, compute the expected profit per round, and decide whether a risk-neutral player should take the bet.
Auto-gradedprobabilityexpected-valuemathcountingCompute the sample mean, the divide-by-n variance, and the divide-by-(n-1) variance from a list of numbers, tying MLE for a normal model to Bessel's correction.
Auto-gradedstatisticsmatharraysfloating-pointParse IPv4 CIDR blocks and simulate step-by-step traversal over all IP addresses in the subnet range.
Auto-gradedbit-manipulationstringsdesignmathCompute the largest integer whose square does not exceed a non-negative integer, without using built-in roots or powers, using monotonic search or an iterative refinement.
Auto-gradedbinary-searchmathnewton-methodinteger-arithmeticCompute the probability that a biased ±1 random walk reaches a target balance before hitting zero, using a recurrence and closed form with careful edge cases.
Auto-gradedprobabilitygambler's ruinrecurrencerandom walkParse 24-hour timestamp strings (including optional seconds and milliseconds) and calculate the minor angle between analog clock hands.
Auto-gradedmathstringsgeometryFind the largest surface area of any rectangle formed by four vertices chosen from a given set of 2D points.
Auto-gradedmathgeometryhashingarraysSimulate grid sliding and merging rules for the game 2048, and design a bit-packing scheme to compress the 4x4 state into a single 64-bit integer.
Model answerbit-manipulationarrayssimulationmatrixCalculate the theoretical minimum number of comparisons needed in the worst case to locate both the largest and second-largest elements among N items.
Auto-gradedmathsortingalgorithmsComputes the expected waiting time for a passenger arriving at a random moment at a stop with probabilistic bus delays.
Auto-gradedmathprobabilitystatisticsexpected-valueFind the minimum cumulative Manhattan distance from a single target point to all target locations in a 2D grid.
Auto-gradedarraysmathsortinggridCalculates the exact binomial probability of obtaining a specific number of heads across a series of fair coin tosses.
Auto-gradedmathprobabilitycombinatoricsDetermine progressive income tax in cents given bracket thresholds and percentage rates using integer math.
Auto-gradedmatharrayssimulationModel a state-dependent betting strategy as a Markov chain and solve absorption probabilities, including cycles, via a linear system.
Auto-gradedprobabilitymarkov-chainlinear-algebragaussian-eliminationComputes baseline and mix-shifted unit profit averages, per-unit margin delta, and overall impact on profit given total volume.
Auto-gradedmatharraysSolve three foundational tasks: uniform random sampling within a disk, tracking the longest strictly increasing contiguous array, and computing bucketed percentiles.
Model answersamplingarraysinterpolationmath