practice a little every day — you've got this ♡
Math & Bit Manipulation Interview Problems
Practice 5966 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.
- 5966
- Problems
- 2209
- Auto-graded
- 15
- Topics
- 271
- Added today
Showing 31–60 of 217 results
- Math & Bit ManipulationEasyModel answerThree Cat Owners and a Truth-or-Lie Rule: Find Bob's Count
Three friends speak under a rule that ties honesty to who owns more cats. Use the statements, parity, divisibility and a sum bound to find Bob's cat count and the triple of counts.
Math & Bit Manipulationlogic-puzzlecase-analysisdivisibilityparity - Math & Bit ManipulationEasyAuto-gradedHead Counts in n Fair Coin Tosses: Sequences and Tail Odds
Compute the number of sequences, the chance of exactly 3 heads, and the chance of at most 3 heads for n fair coin tosses, using binomial counting and handling small n.
Math & Bit Manipulationcombinatoricsbinomialprobabilitymath - Math & Bit ManipulationMediumAuto-gradedCollapse a Sequence to Ones Using Neighbor GCD Replacements
Find the minimum number of neighbor-GCD replacements to turn an entire array into ones, using shortest coprime-window search and a lower-bound argument.
Math & Bit Manipulationgcdsubarraynumber-theorycase-analysis - Math & Bit ManipulationMediumAuto-gradedBinary Message Framing Processor
Simulate encoding and decoding of a length-prefixed binary wire protocol with error validation.
Math & Bit Manipulationbinaryparsingencodingbit-manipulation - Math & Bit ManipulationMediumAuto-gradedPair Growth by Adding One Coordinate to the Other
Decide whether a positive integer pair can grow into a target pair by repeatedly adding one coordinate to the other, using reverse-step reasoning and Euclid-style reduction.
Math & Bit Manipulationmatheuclidean-algorithmreverse-simulationnumber-theory - Math & Bit ManipulationEasyAuto-gradedShelf Stock Versus Random Demand in a Checkout Line
Compute binomial probabilities that a limited stock covers random demand from a line of customers, both as at most M buyers and as exactly M buyers.
Math & Bit Manipulationprobabilitybinomialcombinatoricsmath - Math & Bit ManipulationEasyModel answerCounting Iterations of a C Loop With an Assignment Condition
Work out how many times a C for-loop body runs when its condition is an assignment expression rather than a comparison, and explain the final variable values.
Math & Bit Manipulationc-languagecontrol-flowoperatorsassignment-expression - Math & Bit ManipulationHardAuto-gradedStop or Pass: Optimal Play in a Two-Player Dice Duel
Find the optimal accept/reject rule and the game value for a symmetric alternating-roll zero-sum game, using a stationary fixed-point equation.
Math & Bit Manipulationexpected-valuegame-theoryoptimal-stoppingfixed-point - Math & Bit ManipulationMediumAuto-gradedList Every Prime Not Exceeding a Limit
Tests whether you can enumerate all primes up to a limit efficiently using a sieve instead of per-number primality tests, including the n below 2 edge case.
Math & Bit Manipulationsieveprimesnumber-theoryarrays - Math & Bit ManipulationMediumModel answerBuild an Endless Fibonacci Stream with Python Generators
Explain how lazy evaluation works in Python and write a generator that yields Fibonacci numbers indefinitely, with safe ways to consume it and the reasoning behind its state handling.
Math & Bit Manipulationpythongeneratorslazy-evaluationfibonacci - Math & Bit ManipulationMediumAuto-gradedTwo-Segment Rider Model: Weekly Activity, Posterior, Forecast
Compute three probabilities from a two-group mixture model: at-least-one-success over n days, a Bayesian posterior after all-success streaks, and a posterior predictive forecast.
Math & Bit Manipulationprobabilitybayesmixture-modelcomplement-rule - Math & Bit ManipulationHardAuto-gradedCount Substrings Rearrangeable into Palindromes
Given a list of strings, count the number of contiguous substrings in each string whose characters can be permuted to form a valid palindrome.
Math & Bit Manipulationbit-manipulationhash-tablestringsprefix-sum - Math & Bit ManipulationMediumModel answerCompute Courier Compensation for Delivery Trips
Calculate total delivery earnings from start/end times and distances using conditional rates, rush-hour multipliers, and precision rules.
Math & Bit Manipulationmathparsingsimulation - Math & Bit ManipulationEasyAuto-gradedToken Hop Around a Ring
Compute where a token lands on a ring after k escalating hops, which tests spotting a prefix-sum closed form with modular arithmetic instead of simulating.
Math & Bit Manipulationmathmodular-arithmeticsimulationclosed-form - Math & Bit ManipulationEasyAuto-gradedSimple Interest Earned on a Short-Term Loan
Compute the interest earned on a loan using a simple (non-compounding) annual percentage rate prorated over a number of months.
Math & Bit Manipulationmathsimple-interestarithmeticfinance - Math & Bit ManipulationEasyAuto-gradedPricing Two Coin-Editing Tools in a Four-Coin Game
Compute a baseline expected payoff and the fair prices of two coin-editing tools, using linearity of expectation, a parity invariant, and an absorbing-state argument.
Math & Bit Manipulationprobabilityexpected-valueparity-invariantmarkov-chain - Math & Bit ManipulationMediumAuto-gradedBitwise Quotient Without Multiply, Divide, or Modulo
Compute a truncated 32-bit signed integer quotient using only shifts, addition and subtraction, handling the single overflow case and sign rules efficiently.
Math & Bit Manipulationbit-manipulationmathbinary-searchoverflow - Math & Bit ManipulationMediumAuto-gradedPick Non-Overlapping Words to Cover the Most Letters
Choose a subset of words with no shared letters so the number of distinct letters covered is maximal, which suits bitmask encoding and subset search.
Math & Bit Manipulationbitmaskbacktrackingsubsetsstrings - Math & Bit ManipulationEasyAuto-gradedChance of a 15-Sum Triple from the Leftover Deck
Compute the probability that three cards drawn without replacement from the cards the opponent left behind sum to exactly 15, using combinatorial counting.
Math & Bit Manipulationcombinatoricsprobabilityenumerationitertools - Math & Bit ManipulationMediumAuto-gradedNumerically Stable Focal Loss from Raw Scores
Implement a class-weighted, focus-modulated binary cross-entropy directly from logits in pure Python, with stable math, input validation and sum/mean/none reductions.
Math & Bit Manipulationnumerical-stabilitysigmoidloss-functionfloating-point - Math & Bit ManipulationEasyAuto-gradedMatrix Power and Empirical Transitions for a Markov Chain
Raise a row-stochastic matrix to a given power and build a row-normalized transition estimate from observed index pairs, leaving rows with no data as zeros.
Math & Bit Manipulationmatrix-exponentiationmarkov-chainprobabilitycounting - Math & Bit ManipulationMediumAuto-gradedScale Factor-Model Portfolio Risk to a Yearly Figure
Compute a portfolio's one-period variance from a factor model (exposures, factor covariance, specific variances), then scale it by periods per year and take the square root.
Math & Bit Manipulationmatrixlinear-algebrafinancequadratic-form - Math & Bit ManipulationMediumAuto-gradedWorking Days Between Two Dates with a Closure List
Count Monday-to-Friday days in an inclusive date range, skipping listed closure dates, using week arithmetic instead of day-by-day iteration.
Math & Bit Manipulationdatescalendararithmeticsets - Math & Bit ManipulationMediumAuto-gradedSmallest Primes Prefix: Build the First n Primes
Generate the first n primes in ascending order, which tests sieve design with an upper bound derived from a count, plus handling of non-positive n.
Math & Bit Manipulationprimessievenumber-theorymath - Math & Bit ManipulationEasyAuto-gradedCalculate Credit Card Portfolio Metrics and Partnership Break-Even
Computes the annual net contribution per card, overall portfolio profit, and the minimum number of new accounts needed to cover a marketing campaign.
Math & Bit Manipulationmathfinancial-modelingarithmetic - Math & Bit ManipulationMediumModel answerEight Number Puzzles: Spot the Rule, Predict the Next Value
Work out the hidden rule behind eight short numeric and fractional sequences, state the next term for each, and justify it against every given term.
Math & Bit Manipulationsequencespattern-recognitionrecurrence-relationsmental-math - Math & Bit ManipulationEasyAuto-gradedSingle Row of the Binomial Triangle in Linear Space
Compute one row of Pascal's triangle by index, using only space proportional to the row, via an in-place update or the multiplicative binomial recurrence.
Math & Bit Manipulationpascal-trianglecombinatoricsdynamic-programmingarrays - Math & Bit ManipulationHardModel answerBalanced Character Rewriting and Offline Grid Threshold Queries
Solve parity-based string transformation via bitmasks and handle offline 2D range count queries using dynamic point-update data structures.
Math & Bit Manipulationbit-manipulation2d-fenwick-treesweep-lineprefix-sum - Math & Bit ManipulationEasyAuto-gradedCalculate Expected Return from Two Six-Sided Dice
Computes the expected payoff of a game played with two independent six-sided dice, rounded to two decimal places.
Math & Bit Manipulationmath-bitsprobabilitysimulation - Math & Bit ManipulationEasyAuto-gradedYearly Earnings Report for a Rewards Membership Program
Compute yearly revenue, cost, profit and per-member profit for a membership program from fees, monthly spend commission, and fixed and variable costs.
Math & Bit Manipulationmatharithmeticunit-conversionsimulation