Mark As Completed Discussion

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 mathematics topics like probability, combination, permutation, ratios, and percentage, 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 direction after 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 = 20 slices and each pizza has 4 slices, they should order 5 pizzas (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 6 equal parts, so each part represents 1/6 of the whole.
  • Rolling a fair die labeled 16 for 12 independent trials, the expected number of 1s (the expected value in a binomial model) is 12 × (1/6) = 2, not twelve times, because each roll has a 1-in-6 probability of landing on 1.
  • With equal bags (3 each), John has 12 ÷ 3 = 4 marbles per bag and William has 18 ÷ 3 = 6, so William has 2 more marbles per bag.
  • Of 100 skates, 60% are for boys, leaving 40; 20% of the remainder go to elders (8), so skates for girls = 32.
  • To find the heavier ball among 8 with only 2 uses of a mechanical balance, split into three groups (3-3-2), first weigh 3 vs 3: if one side is heavier, the ball is among those 3—weigh any 2 to locate it; if they balance, the ball is in the remaining 2—weigh them to identify the heavier ball.
  • In permutations—arrangements where order matters—the count is given by the factorial n!, with partial arrangements nPr = n!/(n-r)!, so for A, B, C there are 3! = 6 total and 3P2 = 6 two-letter arrangements, noting 1! = 1 and 0! = 1.
  • With seats labeled positions 1–6 in a single row, E and F are sitting in center (positions 3 and 4), A and B are at the ends (positions 6 and 1 respectively, since C is immediately left of A at position 5), leaving D at position 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) is 5! = 120.
  • By counting the distinct arrangements of the letters in "SWIMMING" with repeats (I and M each twice) using the permutation formula 8!/(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 = 24 ways and arranging the 4 consonants in the remaining slots in 4! = 24 ways, giving 24 × 24 = 576 total permutations.
  • Arrange the consonants M, K, R, R first, giving distinct permutations 4!/2! = 12, then use the gap (slot) method to select 2 of 5 gaps and order A and E in C(5,2) * 2! = 20 ways, 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 examples 3C2 = 3 (AB, BC, CA) and 3C3 = 1, and key identities nCn = 1, nC0 = 1, nC1 = n, and symmetry nCr = nC(n-r).
  • Choose 1 man in 3C1 = 3 ways and choose 3 women in 4C3 = 4 ways using nCk = 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 combinations 5C3*3C2 + 5C4*3C1 + 5C5*3C0, yielding 46 ways.
  • Since a 4-digit number divisible by 10 must have 0 in the units place, we choose the tens, hundreds, and thousands digits from {3,5,7,8,9} in 5×4×3 ways (equivalently 5P3 or 5C1·4C1·3C1), yielding 60 possible numbers.
  • The total number of handshakes is 105 because each handshake corresponds to an unordered pair of distinct people, so we count each pair once using the combination 15C2 = 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 formula P(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 die is 1/6, because the sample 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–exclusion by counting multiples of 3 (10) and multiples of 5 (6) and subtracting multiples of 15 (2).
  • In a leap year (366 days), after 52 full weeks there are 2 leftover 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 is 2/7.
  • Assuming independence, the probability they contradict each other is 35%, computed as P = 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 the inclusion–exclusion principle to event “at least one die is 4” (11 outcomes) and event “sum is 7” (6 outcomes) with 2 in their intersection gives P(E ∪ F) = 15/36 = 5/12.