Exam review with Apple-style bento design covering number conversions, algorithms, database, formulas, tracing patterns, and comparison traps.

Exam review

Six topics. One page.

A curated cheat sheet for ITPEC-style exams. Each tab covers one domain. Each tile teaches one idea.

The golden rule

Split at the point.
Two halves, two methods.

Integer — divide by base, read remainders bottom up.
Fraction — multiply by base, read carries top down.
Decimal → binary · integer

Convert 13

13 ÷ 2 = 6 r 1 ↑ 6 ÷ 2 = 3 r 0 ↑ 3 ÷ 2 = 1 r 1 ↑ 1 ÷ 2 = 0 r 1 ↑
13₁₀ = 1101₂
Decimal → binary · fraction

Convert 0.625

0.625 × 2 = 1.25 → 1 ↓ 0.25 × 2 = 0.5 → 0 ↓ 0.5 × 2 = 1.0 → 1 ↓
0.625₁₀ = 0.101₂
To decimal

Multiply each digit by base raised to its position.

Left of point: 0, 1, 2, …  ·  Right of point: −1, −2, −3, …
Binary → decimal
1101.101₂
1·2³ + 1·2² + 0·2¹ + 1·2⁰ + 1·2⁻¹ + 0·2⁻² + 1·2⁻³
= 13.625
Octal → decimal
17.4₈
1·8¹ + 7·8⁰ + 4·8⁻¹
= 15.5
Hex → decimal
2A.8₁₆
2·16¹ + A·16⁰ + 8·16⁻¹
= 42.5
Shortcut · binary ↔ octal

Group bits in threes

110101.1101 → 110 101 . 110 100 → 6 5 . 6 4
= 65.64₈
Shortcut · binary ↔ hex

Group bits in fours

11011010.1011 → 1101 1010 . 1011 → D A . B
= DA.B₁₆
Hex digit map

Memorize

A=10 B=11 C=12 D=13 E=14 F=15
Powers of 2

Memorize

2¹=2 2²=4 2³=8 2⁴=16 2⁵=32 2⁶=64 2⁷=128 2⁸=256 2⁹=512 2¹⁰=1024
Smaller · negative powers

For times, signals, capacitance

PowerSymbolNameMeaning
10⁻³mmillithousandth
10⁻⁶μmicromillionth
10⁻⁹nnanobillionth
10⁻¹²ppicotrillionth
10⁻¹⁵ffemtoquadrillionth
Larger · positive powers

For storage, frequency, bandwidth

PowerSymbolNameMeaning
10³kkilothousand
10⁶Mmegamillion
10⁹Ggigabillion
10¹²Tteratrillion
10¹⁵Ppetaquadrillion
Trap
In storage, "kilo" sometimes means 1024. Modern usage: kB = 1000, KiB = 1024. ITPEC means decimal unless they write KiB.
Search algorithms

Time complexity

AlgorithmBestAvgWorst
LinearO(1)O(n)O(n)
BinaryO(1)O(log n)O(log n)
HashO(1)O(1)O(n)
BSTO(1)O(log n)O(n)
Remember
Binary search needs a sorted array. Hash and BST hit worst case when collisions or skewed trees ruin the bucketing.
Sorting algorithms

Time complexity

AlgorithmBestAvgWorst
BubbleO(n)O(n²)O(n²)
SelectionO(n²)O(n²)O(n²)
InsertionO(n)O(n²)O(n²)
MergeO(n log n)O(n log n)O(n log n)
QuickO(n log n)O(n log n)O(n²)
HeapO(n log n)O(n log n)O(n log n)
ShellO(n log n)O(n^1.25)O(n²)
Remember
Merge and heap are reliably n log n. Quicksort matches them on average but degrades on bad pivots.
ACID

Four guarantees a transaction must keep.

A
Atomicity
All steps commit, or none do.
C
Consistency
Constraints always hold.
I
Isolation
Concurrent txns don't see mid-state.
D
Durability
Survives crashes once committed.
SQL clause execution order

Written one way. Run another.

SQL is written SELECT-first but executed FROM-first. The real order tells you what's available where.
1. FROM (and JOIN) build the working set 2. WHERE filter rows 3. GROUP BY group remaining rows 4. HAVING filter groups (aggregates allowed) 5. SELECT project columns 6. ORDER BY sort result 7. LIMIT / OFFSET trim
Classic trap
You cannot use SUM / COUNT / AVG inside WHERE — rows aren't grouped yet. Aggregates only work in HAVING and SELECT.
JOIN types

How tables combine

INNER
Matching rows from both
LEFT OUTER
All left + matched right
RIGHT OUTER
All right + matched left
FULL OUTER
All rows from both
CROSS
Every row × every row
Subquery operators

Test against a result set

IN
Col matches any returned
NOT IN
Col matches none
EXISTS
Subquery returns ≥ 1 row
= ANY
Same as IN
= ALL
Col equals every value
Cloud service models

Higher up the stack, less you manage.

ModelProvider managesCustomer managesExample
IaaSHardware, virt, networkOS, runtime, app, dataAWS EC2, GCP Compute
PaaS+ OS, runtime, middlewareApp + data onlyHeroku, App Engine
SaaSEverythingJust config + dataGmail, Salesforce
Merit question
PaaS reduces install / operation burden — provider patches the platform. SaaS removes operational concerns (failover, backups) but not security policy obligations.
DB design levels

Three layers of abstraction

Conceptual
ER · entities · relationships
Logical
Relations · keys · normalization
Physical
Storage · indexes · datatypes
Normalization

Each form removes one redundancy

1NF
Atomic columns
2NF
1NF + no partial key dep
3NF
2NF + no transitive dep
BCNF
3NF + every determinant is a key
IEEE 754 · single precision

How a 32-bit float is stored

Sign + biased exponent + mantissa. Practice converting bits → decimal in 30 seconds.
value = (−1)ˢ × 2^(E − 127) × (1 + F)
S sign bit (1 bit) E biased exponent (8 bits, bias 127) F mantissa (23 bits, fractional)
HDD average access time

Four delays, summed.

Reading one block from a spinning disk is the sum of four independent waits. Knowing each component is what gets tested.
total = seek + controller + rotational latency + transfer rotational latency = ½ × (60 / RPM) seconds transfer time = block_size / rate seconds
Why ½ on rotation
A full rotation takes 60/RPM seconds. On average the sector is half a rotation away — sometimes right there, sometimes a full turn out. Mean = half a rotation.
MIPS

CPU speed metric

Million instructions per second.
MIPS = clock_MHz / CPI
Cache effective access

Average memory time

Hit rate weights the two paths.
T = h·t_cache + (1−h)·t_main
PERT estimate

Three-point duration

Most-likely is weighted heavier.
O + 4M + P 6
Series availability

All must work

Availability multiplies down. Adding parts hurts.
A = A₁ × A₂ × … × Aₙ
Parallel availability

At least one must work

Compute the chance all fail, then flip it.
A = 1 − (1 − A)ⁿ
SLA max downtime

How long you can be down

Service hours times your error budget.
downtime = service_hrs × (1 − target)
Straight-line depreciation

Even value drop per year

Each year drops by the same amount.
annual = cost − salvage useful_life
Scheduling metrics

Three ways to measure a scheduler

MetricDefinitionUnitDirection
ThroughputProcesses done per unit timejobs / secHigher is better
TurnaroundArrival → completion (wait + burst + I/O)secondsLower is better
Response timeArrival → first CPU allocationsecondsLower is better
turnaround = waiting + burst (CPU-only) waiting = turnaround − burst response ≤ turnaround (always)
Trap
Response is the wait until first execution. Turnaround includes everything until completion. They diverge in preemptive schedulers where a job starts, pauses, then finishes much later.
FCFS · first come first served

The simplest scheduler

Run whoever arrived first to completion. No preemption. Easy by hand.
completion(i) = arrival(i) + waiting(i) + burst(i) turnaround(i) = completion(i) − arrival(i) waiting(i) = turnaround(i) − burst(i) avg turnaround = Σ turnaround(i) / n avg waiting = Σ waiting(i) / n
Convoy effect
One long job at the front of the queue makes everyone wait. FCFS performs badly when burst times vary a lot.
FCFS · worked example

Three processes, all arrive at time 0

Run in arrival order, no preemption. Bursts: P1=8, P2=4, P3=2.
P1
P2
P3
0
8
12
14
ProcessBurstWaitTurnaround
P1808
P24812
P321214
·
Avg wait = (0 + 8 + 12) / 3 = 6.67
·
Avg turnaround = (8 + 12 + 14) / 3 = 11.33
Compare with SJF
P3 only needs 2 units but waits 12. If we'd run shortest-first (P3 → P2 → P1), avg wait drops to (0 + 2 + 6) / 3 = 2.67. That's why SJF beats FCFS on average.
Permutations · nPr

Order matters

Pick r items from n where arrangement counts — first/second/third are different outcomes.
ⁿPᵣ = n! (n − r)!
Example
Race with 5 runners, how many ways to fill gold/silver/bronze? ⁵P₃ = 5! / 2! = 60.
Combinations · nCr

Order doesn't matter

Pick r items from n where you only care which were chosen, not the order.
ⁿCᵣ = n! r! × (n − r)!
Example
Pick a 3-person committee from 5 people. ⁵C₃ = 5! / (3! × 2!) = 10. nCr is always smaller than nPr by a factor of r!.
Group probability

k items adjacent in n slots

P = (n − k + 1)! × k! n!
Bit-shift × tricks

Multiply by shift + add

9n = (n<<3) + n 7n = (n<<3) − n 5n = (n<<2) + n 3n = (n<<1) + n
Defect cost expected value

The chain of multiplications

Multiply down the funnel — total → defective → discovered → in this category → cost each.
EV = size × defect_rate × discovery_rate × category_share × cost_per_defect
Key types · symmetric vs asymmetric

One key or two?

Symmetric uses one shared secret for both encrypt and decrypt — fast, but you have to get the secret to the other party safely. Asymmetric (public-key) uses a key pair — what one key locks, only the other can unlock. Slower, but solves the key-distribution problem.
TypeKeysSpeedUse caseExamples
Symmetric1 sharedFastBulk data encryptionAES, DES, 3DES
Asymmetric2 (public + private)SlowKey exchange, signaturesRSA, ECC, DSA
Hash0 (one-way)FastIntegrity, fingerprintsSHA-256, MD5
In practice · the hybrid trick
TLS / HTTPS uses both. Asymmetric to exchange a session key safely, then symmetric to encrypt the actual conversation. You get the key-distribution benefit of asymmetric and the speed of symmetric.
Public-key · which key when

Two opposite uses

Confidentiality
Encrypt
Receiver's public
Decrypt
Receiver's private
Signature
Sign
Sender's private
Verify
Sender's public
Memory hook
The private key always belongs to the person doing the secret thing — opening their own mail, signing their own document. The public key is for everyone else.
RSA · inventors

Three names, one acronym

Published in 1977 at MIT. The acronym is just their surnames in order.
R
Ron Rivest
S
Adi Shamir
A
Leonard Adleman
How it works
Security relies on the difficulty of factoring the product of two large primes. Easy to multiply, brutally hard to reverse — that asymmetry is the whole trick.
Four pillars of OOP

The vocabulary every OOP question is built on.

Encapsulation
Bundle data + methods, hide internals.
Inheritance
Subclass extends superclass, reuses members.
Polymorphism
Same interface, different implementations.
Abstraction
Expose essential interface, hide implementation.
Class · object · method · constructor

Foundational vocabulary

ITPEC distractors swap these definitions around. Read the wording carefully.
Class
Blueprint defining structure + behavior
Object
Concrete realization of a class in memory
Instance
Same as object
Method
Function inside a class, operates on instances
Constructor
Special method that initializes a new instance
Overloading · overriding · hiding

Three ways to share a name

TermWhat it meansResolved at
OverloadingSame name, different paramsCompile time
OverridingSame signature in subclassRuntime
HidingSame field / static nameReference type
OSI model · 7 layers

Top down · device at each level

7
Application
HTTP, FTP, DNS
6
Presentation
TLS, encoding
5
Session
Sockets
4
Transport
Gateway · TCP/UDP
3
Network
Router · IP
2
Data link
Switch, bridge · MAC
1
Physical
Hub, repeater · cable
ARP behavior

Maps IP → MAC

Request
Broadcast (FF:FF:…)
Reply
Unicast
Public-key direction

Two opposite uses

Signature
Sign
Sender's private
Verify
Sender's public
Confidentiality
Encrypt
Receiver's public
Decrypt
Receiver's private
Security devices

What sits where

IDS
Detect + alert
IPS
Detect + block
WAF
HTTP-aware filter
Firewall
Network-level filter
MTD · RTO · RPO

Disaster recovery limits

RTO ≤ MTD
Recovery time
RPO ≤ MTD
Data loss tolerance
RPO
Backward in time
RTO
Forward in time
Test levels

In order

Unit → Integration → System → Acceptance
Integration
Module interfaces
Acceptance
User · business fit
Coverage hierarchy

Strictness order

statement < branch < condition < multi-condition < path
Static vs dynamic testing

Execution or not

Static
No executionLint, source analysis
Dynamic
With executionProfiling, coverage
Reverse vs forward eng.

Direction

Reverse
Code → diagram
Forward
Design → code
Process vs product

Innovation type

Process
Better manufacturing
Product
New / differentiated
Fraud triangle

Three conditions

Opportunity
Enables
Pressure
Motivates
Rationalization
Justifies
Data structures · in motion

Pick a structure. Run the operations. Watch what happens.

Tap an operation to see how the pointers rewire.
Doubly linked nodes carry both next and prev. Watch all four pointers move on insert.
In a circular list, the tail's next wraps back to the head — no null. Tap Traverse to see why you need a stop condition.
LIFO — last in, first out. Push grows the top. Pop removes from the same end.
FIFO — first in, first out. Enter at the rear, leave from the front.
Pick a traversal. Watch the order each node is visited. Pre/in/post refers to when the root is visited relative to its subtrees.
Linear probing with h(k) = k mod 7, where k is the value you're inserting. The function picks a "home slot" for that value. On collision, walk forward until you find an empty slot.