One Pager Cheat Sheet
- Emphasizing problem solving and analytical skills as foundational to programming interviews, this AlgoDaily tutorial helps candidates by visualizing problems and solutions and offering a road map through
basic mathematicstopics likeprobability,combination,permutation,ratios, andpercentage, noting that interviewers may overlook minor syntax hiccups but not weak reasoning. - An analytical reasoning puzzle (with a brief visualization) asks for Samuel's final
directionafter he starts walking towards east, then turns left, turns left again at the bus stop, and finally turns right after 1 km. - Since
10 × 2 = 20slicesand eachpizzahas4slices, they should order5pizzas (20 ÷ 4 = 5). - Lana has 2 bags of 2 marbles (
2*2=4) and Markus has 2 bags of 3 marbles (2*3=6), so Markus has 2 more marbles (difference = 6-4 = 2). - Kate divides the portrait into
6equal parts, so each part represents1/6of the whole. - Rolling a fair die labeled
1–6for12independent trials, the expected number of1s (theexpected valuein abinomialmodel) is12 × (1/6) = 2, not twelve times, because each roll has a 1-in-6 probability of landing on1. - With equal bags (
3each), John has12 ÷ 3 = 4marbles per bag and William has18 ÷ 3 = 6, so William has 2 more marbles per bag. - Of
100skates,60%are for boys, leaving40;20%of the remainder go to elders (8), so skates for girls =32. - To find the heavier ball among
8with only2uses of amechanical balance, split into three groups (3-3-2), first weigh3vs3: if one side is heavier, the ball is among those3—weigh any2to locate it; if they balance, the ball is in the remaining2—weigh them to identify the heavier ball. - In permutations—arrangements where order matters—the count is given by the
factorialn!, with partial arrangementsnPr = n!/(n-r)!, so for A, B, C there are3! = 6total and3P2 = 6two-letter arrangements, noting1! = 1and0! = 1. - With seats labeled
positions 1–6in a single row, E and F are sitting in center (positions 3and4), A and B are at the ends (positions 6and1respectively, sinceCis immediately left ofAatposition 5), leavingDatposition 2, so the person at the right of B is D. - Because 'CHAIR' has 5 distinct letters, the number of words that can be formed (i.e.,
permutations) is5! = 120. - By counting the distinct arrangements of the letters in "SWIMMING" with repeats (
IandMeach twice) using thepermutationformula8!/(2!*2!), the total number of words is 10080. - Count permutations of "REMAINS" with the vowels in odd positions by placing the 3 vowels in the 4 odd slots in
4P3 = 24ways and arranging the 4 consonants in the remaining slots in4! = 24ways, giving 24 × 24 = 576 total permutations. - Arrange the
consonantsM, K, R, R first, giving distinct permutations4!/2! = 12, then use the gap (slot) method to select2of5gapsand order A and E inC(5,2) * 2! = 20ways, yielding 240 arrangements with no vowels adjacent. - A combination is a selection where order is not important, counted by
nCr = n! / [r! * (n-r)!], with examples3C2 = 3(AB, BC, CA) and3C3 = 1, and key identitiesnCn = 1,nC0 = 1,nC1 = n, and symmetrynCr = nC(n-r). - Choose 1 man in
3C1 = 3ways and choose 3 women in4C3 = 4ways usingnCk = n!/(k!(n-k)!), so the total number of committees is 12. - From 5 black and 3 red balls, the number of 5-ball selections with at least 3 black balls is computed by summing
combinations5C3*3C2 + 5C4*3C1 + 5C5*3C0, yielding 46 ways. - Since a 4-digit number divisible by 10 must have
0in theunits place, we choose thetens,hundreds, andthousandsdigits from{3,5,7,8,9}in5×4×3ways (equivalently5P3or5C1·4C1·3C1), yielding 60 possible numbers. - The total number of handshakes is 105 because each handshake corresponds to an
unordered pairof distinct people, so we count each pair once using thecombination15C2=15*14/2, which avoids double-counting. - Probability is a branch of mathematics that measures the likelihood (0 to 1) of a
random event, illustrated by coin toss outcomes (one toss:(H, T); two coins:(H,H),(H,T),(T,T)), and calculated using the formulaP(E) = Number of favorable outcomes / Total number of outcomes. - With 6 pillows (3 red, 2 yellow, 1 blue), the probability of picking a yellow pillow is
2/6=1/3. - From 1000 picks (300 blue, 200 red, 450 green, 50 orange), the probability of picking a green bottle is
P(green) = 450/1000 = 0.45, and the likely number of green bottles in a 100-bottle container is 45. - The probability of getting 3 when
rolling a fair dieis1/6, because thesample space{1,2,3,4,5,6}has six outcomes and only one favorable event{3}. - In a standard 52-card deck, the probability of drawing a face card (Jack, Queen, or King) is
12/52 = 3/13, since there are 12 favorable outcomes (3 ranks × 4 suits) out of 52 total outcomes. - The probability that a randomly drawn ticket from 1–30 is a multiple of 3 or 5 is 14/30 = 7/15, computed via
inclusion–exclusionby countingmultiples of 3(10) andmultiples of 5(6) and subtractingmultiples of 15(2). - In a leap year (
366days), after52full weeks there are2leftover consecutive days that can be any of seven weekday pairs, and since Monday occurs in two of these pairs, the probability of getting 53 Mondays is2/7. - Assuming
independence, the probability they contradict each other is 35%, computed asP = P(A truth)P(B lie) + P(A lie)P(B truth) = 0.75*0.2 + 0.25*0.8 = 0.35. - Rolling two fair dice yields 36 equally likely outcomes in the
sample space; applying theinclusion–exclusion principleto event “at least one die is 4” (11 outcomes) and event “sum is 7” (6 outcomes) with 2 in their intersection givesP(E ∪ F)= 15/36 = 5/12.



