General Aptitude
Divisibility by 11 — Alternate sum: subtract sum of odd-position digits from even-position digits; if result is 0 or divisible by 11, original number is too. (e.g., 121: 1-2+1=0 ✓)
Calendar Day Formula (Doomsday) — Remember 4/4, 6/6, 8/8, 10/10, 12/12 fall on same weekday each year; add "9-to-5 at 7-11" (9/5, 7/11, 11/7, 5/9) as anchors to quickly find any date's day.
Percentage-Fraction Equivalents — Memorize: 12.5%=1/8, 16.67%=1/6, 20%=1/5, 25%=1/4, 33.33%=1/3, 37.5%=3/8, 62.5%=5/8, 66.67%=2/3, 87.5%=7/8 for instant mental calculation.
Compound Interest Approximation — For small rates: CI ≈ SI + (SI×rate×time)/200. For doubling time: 72/rate ≈ years (Rule of 72); for tripling: 114/rate.
Clockwise/Anticlockwise Turns — Right turns = clockwise = add angles; Left turns = anticlockwise = subtract angles. Four 90° rights or lefts return to original direction.
Probability Quick Check — All probabilities sum to 1; if P(A)=0.6 and events independent, P(A and B)=P(A)×P(B); complement rule: P(not A)=1−P(A).
Mensuration Units Trick — Length²=Area (m→m²); Length³=Volume (m→m³). To convert: 1m²=10,000cm² (square the 100); 1m³=1,000,000cm³ (cube the 100).
Algorithms
Time Complexity Hierarchy — Remember: 1 < log n < √n < n < n log n < n² < n³ < 2ⁿ < n! — each dominates the previous for large n.
Master Theorem Quick Cases — T(n)=aT(n/b)+f(n): If f(n)=O(n^c), compare c with log_b(a). c < log: Θ(n^log); c = log: Θ(n^c log n); c > log: Θ(f(n)).
Sorting Stability Mnemonic — "BIM QHRS" — Stable: Bubble, Insertion, Merge; Unstable: Quick, Heap, (Selection—exception depends on implementation). Remember merge always stable, quick typically not.
BFS vs DFS Usage — BFS for Shortest (level-by-level, uses Queue); DFS for Connectivity (goes deep, uses Stack/recursion). BFS=breadth=queue; DFS=depth=stack.
Greedy vs DP Decision — Greedy works when local optimum = global optimum (Huffman, Dijkstra, Kruskal). DP needed for overlapping subproblems with optimal substructure (knapsack, LCS).
Dynamic Programming Pattern — Identify: overlapping subproblems (recalculating same values) + optimal substructure (solution built from subsolutions). Memoize or tabulate; recurrence → table → answer.
Computer Organization & Architecture
RISC vs CISC — RISC: Reduced, Register-heavy, Pipelined, Load-store; CISC: Complex, Memory-operations, Fewer registers, Variable instruction length. RISC=simple+fast; CISC=compact+fewer instructions.
Cache Mapping Types — Direct: Block mod Lines (fast, high conflict); Fully Associative: Any block anywhere (flexible, costly); Set Associative: Hybrid (n-way = n blocks per set).
Pipeline Hazards (SCD) — Structural (hardware resource conflict), Control (branch/jump), Data (RAW, WAR, WAW dependencies). RAW most common: Read After Write.
Amdahl's Law Quick — Speedup = 1/[(1−P) + P/S], where P=parallelizable fraction, S=speedup of that part. Maximum speedup limited by sequential portion (1−P).
Compilers
Compiler Phases Order — "Lazy Students Piss Instructors Cruelly, Ordering Chaos Greatly" — Lexical, Syntax, Semantic, Intermediate code, Code optimization, Code generation. (Some add Preprocessing before, Linking after.)
Lexical vs Syntax vs Semantic — Lexical: tokens/words (identifier validity); Syntax: grammar/sentence (expression structure); Semantic: meaning (type checking, scope). Token→Structure→Meaning.
LL vs LR Parsing — LL: Left-to-right, Leftmost derivation (top-down, predictive); LR: Left-to-right, Rightmost in reverse (bottom-up, shift-reduce). LL(1) simpler; LR(1) more powerful.
Three-Address Code — Each instruction has ≤3 addresses: x = y op z. Easily maps to quadruples (op, arg1, arg2, result). Foundation for intermediate representation.