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 91–120 of 217 results
Compute the slope and intercept for a univariate linear regression model using ordinary least squares.
Auto-gradedmatharraysstatisticsDefine pricing rules for percent-off and buy-X-get-Y promotions, then build an algorithm that returns the lowest legal total for a cart, covering stacking, repeats, and rounding.
Model answerpricingdiscountsrequirements-clarificationgreedyCompute the exact probability that the product of two independent Uniform(0,1) values exceeds 1/2, by integrating over the region of the unit square above a hyperbola.
Auto-gradedprobabilityintegrationcontinuous-distributionsclosed-formFind the maximum number of elements from an array whose sum is at most a given target n, and compute the k-th smallest positive divisor of a number N.
Auto-gradedmathsortinggreedyprefix-sumUnderstand JavaScript numeric edge cases, floating-point precision constraints, and how to safely implement custom checks without built-in helpers.
Model answerjavascriptieee-754numeric-precisiontype-coercionDetermine if two initial quantities can reach equality through deterministic transfers that double the recipient stack.
Auto-gradedmath-bitsnumber-theorybit-manipulationsimulationApply a simple profit model with fixed costs, a rent-proportional cost and a target return to find a required rent and a required occupancy.
Auto-gradedmathbreak-evenunit-economicsalgebraCompute the expected number of strict running maximum records for a uniformly random ordering of a collection of numbers.
Auto-gradedmathprobabilityarraysApply Bayes' rule to find the chance a randomly chosen contestant was the strongest one, given that it did not win a three-way contest.
Auto-gradedprobabilitybayes-ruleconditional-probabilitymathA practice collection covering essential algorithms: bit manipulation, two pointers, monotonic stack, dynamic programming, binary search, tree path XORs, and graph re-rooting.
Model answerbit-manipulationmonotonic-stacktree-dpdynamic-programmingSimulate a transformation that replaces a number with the sum of its squared digits, determining if it terminates at 1 or loops indefinitely.
Auto-gradedmathhash-tabletwo-pointersCompute precision, recall, specificity, F1 and accuracy from confusion-matrix counts, returning 0.0 for any metric whose denominator is zero.
Auto-gradedmetricsconfusion-matrixedge-casesarithmeticCalculates the probability that at least two of three kept items are red when green items are returned upon selection.
Auto-gradedmathcombinatoricsprobabilityModel a price as a two-step random walk, reduce it to a binomial lower tail with a strict cutoff, and sum that tail in a numerically stable way.
Auto-gradedprobabilitybinomialnumerical-stabilityrandom-walkComputes the optimal decision threshold and overall expected payoff when given one optional reroll on an N-sided die.
Auto-gradedmathprobabilityexpected-valuedynamic-programmingFind the integer count of each animal species given the total legs and proportional species constraints.
Auto-gradedmathalgebraFind the maximum count of distinct letters that can be collected by picking a mutually disjoint subset of strings.
Auto-gradedbit-manipulationbacktrackingdynamic-programmingstringsCount unique pairs of non-negative integers whose squares sum to a target value, identifying numbers with exactly two representations up to a limit N.
Model answermath-bitsarraysmathProcess a series of deposits, conditional withdrawals, and integer floor cashbacks to compute a final account balance.
Auto-gradedsimulationmatharraysAnswer three short reasoning items (number sequence, repeating symbols, sentence completion) and explain a time-boxed strategy for a 50-item, 15-minute screen with no wrong-answer penalty.
Model answeraptitudepattern-recognitionmodular-arithmetictime-managementCompute the break-even target for new customer acquisitions under base and spend-uplift promotional scenarios.
Auto-gradedmathunit-economicsfinancial-modelingCompute precision and recall from the four confusion-matrix counts of a binary classifier, returning 0.0 for a metric whose denominator is zero.
Auto-gradedmathconfusion-matrixprecision-recalledge-casesApply a first-order Taylor expansion to get the approximate variance of a ratio of two correlated sample means, including the covariance term.
Auto-gradeddelta-methodvariancecovarianceratio-metricsParse two ISO-style date strings and compute the absolute day gap using manual Gregorian leap-year logic, without any date or calendar library.
Auto-gradeddate-arithmeticleap-yearstring-parsingmathExplain the physical cause of hot summers and cold winters, then compute the balance of a $1,000 deposit that earns 100% interest compounded yearly for 20 years.
Model answerestimationcompound-interestexponential-growthmental-mathSimulate a codec session that buffers int32 values, emits run-length and bit-packed blocks on flush, and decodes block lists back to integers.
Auto-gradedbit-manipulationcompressionsimulationtwos-complementCompare two groups' success rates per stratum and pooled, using exact integer cross-multiplication, to detect when a consistent stratum winner flips in the aggregate.
Auto-gradedsimulationfractionsaggregationsimpsons-paradoxCompute the exact reduced probability that the three smallest of four independent weighted dice sum to 3, which reduces to counting weighted outcomes with at least three ones.
Auto-gradedprobabilitycombinatoricsfractionscountingApply model, view and projection matrices to a point, do the perspective divide and viewport mapping, and transform a normal with the inverse-transpose of the model's 3x3 block.
Auto-gradedlinear-algebramatriceshomogeneous-coordinatessimulationCompute a probability for a draw process with discarded-and-returned items by reducing it to a hypergeometric count, ignoring the irrelevant returned category.
Auto-gradedprobabilitycombinatoricshypergeometricmath