Backend Developer
Math and simulation questions
116 questions on Math and simulation for backend developers, easiest first.
Easy 34
- Remainder of a negative numbereasy
- Why 0.1 + 0.2 is not 0.3easy
- Storing rupee amounts safelyeasy
- GST inside an inclusive priceeasy
- How many buses are neededeasy
- Checking for a power of twoeasy
- Which year is a leap yeareasy
- Month number in new Dateeasy
- Finding the nearest point fasteasy
- Clamping a value into a rangeeasy
- Math.sin(90) is not 1easy
- Sum of 1 to 100easy
- Random whole number in a rangeeasy
- Percent up, then back downeasy
- Reading binary 1011easy
- Hex colour to RGB valueseasy
- Median of four valueseasy
- Checking for NaNeasy
- Dividing by zero in JavaScripteasy
- Interpolating a quarter of the wayeasy
- Moving at the same speed on any deviceeasy
- VAT inside a UAE priceeasy
- Compound interest over two yearseasy
- Converting Dubai time to India timeeasy
- parseInt with a radixeasy
- Sum of 5, 10, ..., 100easy
- Years to double at 8%easy
- Average roll of a dieeasy
- Binary search steps for 1 millioneasy
- Typical salary with one outliereasy
- Turning an ADC reading into voltseasy
- PWM duty cycle and average voltageeasy
- First byte of 0x12345678 in memoryeasy
- Batch or stream processingeasy
Medium 49
- XOR of a rangemedium
- Maximum XOR of two numbersmedium
- Next index in a Fenwick updatemedium
- Slope as a map keymedium
- Find the extra lettermedium
- LCM of 84 and 36medium
- Computing LCM without overflowmedium
- Cost of the sieve of Eratosthenesmedium
- Testing whether 97 is primemedium
- Trailing zeros in 100!medium
- How many divisors 360 hasmedium
- The 100 lockers puzzlemedium
- 2**31 | 0 in JavaScriptmedium
- What -1 >>> 0 givesmedium
- Loop count of n &= n - 1medium
- Finding the one unpaired idmedium
- What n & -n returnsmedium
- Why (1.005).toFixed(2) is 1.00medium
- Math.round(-2.5) in JavaScriptmedium
- C-style integer division in JSmedium
- Stacking 20% and 10% discountsmedium
- Average order value across storesmedium
- Two people with the same birthdaymedium
- Chance two dice sum to 7medium
- Spreadsheet column for number 28medium
- Ways to pick 3 of 10medium
- Arrangements of the word BANANAmedium
- Binary search trees from 3 keysmedium
- Why fib(50) never finishesmedium
- Rotating a grid 90° clockwisemedium
- Game of Life updates go wrongmedium
- Shortest turn from 350° to 10°medium
- Angle of the vector (-1, -1)medium
- Is a rider inside the zonemedium
- Do these two circles collidemedium
- Bouncing a ball off the floormedium
- Is the player in front of the guardmedium
- Enemy vanishes on reaching playermedium
- Clock hands at 3:15medium
- Adding one month to 31 Januarymedium
- Day count off by a fractionmedium
- Reading MCMXCIVmedium
- Reversing digits of a 32-bit intmedium
- Requests in flight with Little's lawmedium
- Finding p95 from 20 timingsmedium
- Timer check across a counter wrapmedium
- Reading 0xF0 as a signed bytemedium
- One step of a smoothing filtermedium
- How often an 8-bit timer overflowsmedium
Hard 33
- Bias from random byte % 100hard
- Shuffling with sort and Math.randomhard
- Fisher-Yates with one wrong boundhard
- Midpoint overflow in binary searchhard
- Inverse of 3 modulo 7hard
- Computing a large power mod mhard
- Adding 1 to 2^53hard
- What Kahan summation fixeshard
- A fixed epsilon on large numbershard
- Area of a five-point plothard
- Left or right turn from a cross producthard
- Do two booking slots overlaphard
- Distance between two GPS pointshard
- EMI on a one-year loanhard
- Splitting ₹100 three wayshard
- Picking one random log line from a streamhard
- Weighted random server choicehard
- Making a Monte Carlo result 10× more precisehard
- A planet spirals away in a simulationhard
- A physics loop that never catches uphard
- Camera smoothing differs by frame ratehard
- Rotate then translate a pointhard
- Moving a model also moves its normalshard
- Lighting breaks after squashing a modelhard
- Upper bound of the fifth retry delayhard
- Luhn check digithard
- How an IBAN is checkedhard
- Replacing % with a bit maskhard
- Multiplayer games drifting aparthard
- Tax on ₹9 lakh with slabshard
- Multiplying two Q8.8 numbershard
- Brightness 200 + 100 goes darkhard
- Gray code of the number 6hard