Last Hour Cheat Sheet
tags: - cocubes - revision - cheat-sheet
Last-Hour Cheat Sheet
Read this once before the test. Do not try to learn new theory now.
Aptitude
- Net successive percent change: a + b + ab/100 for two increases; a ā b ā ab/100 for increase then decrease.
- Average = total/count. Rebuild total after adding/removing a value.
- Work: add rates, not days.
- Equal-distance average speed = 2xy/(x+y).
- Train: convert km/h to m/s using 5/18.
- Probability: at least one = 1 ā none.
- Unit digits repeat in cycles.
- Neither/either usually take singular verb in standard tests.
- Use a/an by sound: a university, an honest person.
- Syllogism: never reverse "All A are B."
Technical
- Queue FIFO, stack LIFO, hash lookup average O(1).
- BFS queue/unweighted shortest path; DFS stack/recursion.
- Binary search needs sorted input.
- Merge sort O(n log n), stable; quicksort worst O(n²).
- Process own memory; thread shares process memory.
- Page fault = page absent from RAM.
- Deadlock: mutual exclusion, hold-wait, no preemption, circular wait.
- TCP reliable; UDP connectionless.
- DNS 53, HTTP 80, HTTPS 443, SSH 22, DHCP 67/68.
- /27 = 30 traditional usable hosts.
- ARP IP to MAC; DNS name to IP; DHCP IP settings.
- ADC analogue to digital; watchdog resets hang; I2C two-wire.
- Waterfall sequential; Agile iterative; sprint = time box.
- Regression = old features after a change; retesting = confirm particular fix.
Pseudocode
- Write a variable table.
- MOD = remainder; DIV = integer quotient.
- WHILE can run zero times; REPEAT runs at least once.
- Update values line by line in order.
- ELSE goes to nearest unmatched IF.
- State recursion base case.
- Loop doubling/halving is O(log n).
Coding
- Read constraints first.
- Secure the easiest problem first.
- Test n=0/1 if allowed, duplicates, negatives, extremes.
- Sum/max/count: one scan.
- Frequency/pair: hash map.
- Sorted pair/palindrome: two pointers.
- Balanced brackets: stack.
- Shortest unweighted grid: BFS.
Games
- Tutorial first; no random clicking.
- Motion: plan path backward from target.
- Grid: chunk locations/order.
- Switch: use feedback to eliminate possibilities.
- Digit: estimate, then calculate.
[[00_Start_Here/Dashboard|Back to dashboard]]