Computer Science Principles
AP CSP Comprehensive Study Sheet
AP COMPUTER SCIENCE PRINCIPLES
COMPREHENSIVE EXAM STUDY SHEET
Big Ideas: Creative Development · Data · Algorithms & Programming · Computing Systems & Networks · Impact of Computing
1. CREATIVE DEVELOPMENT (CRD)
Core Vocabulary
| Term | Definition |
|---|---|
| Program | A sequence of statements executed by a computer to complete a task |
| Algorithm | A finite, precise, effective step-by-step process for solving a problem |
| Abstraction | Reducing complexity by hiding irrelevant details; focusing on what matters |
| Decomposition | Breaking a complex problem into smaller, manageable sub-problems |
| Modularity | Dividing a program into independent, interchangeable components (procedures) |
| Iteration (dev) | Repeatedly revising and improving a program over time based on testing/feedback |
| Collaboration | Working with others using communication, consensus-building, and shared credit |
Program Development Lifecycle
Typical Development Process
-
- Investigate & Reflect — Define the problem; identify user needs; research existing solutions
-
- Design — Plan the algorithm; create flowcharts or pseudocode; select data structures
-
- Implement — Write code; use procedures and abstractions to manage complexity
-
- Test — Run with normal, edge, and invalid inputs; identify and fix errors
-
- Iterate — Revisit any earlier step based on test results; refine until requirements are met
- ★ Development is rarely linear — jumping between phases is normal and expected
Errors (Know all 3 types for exam)
| Error Type | Description | Example |
|---|---|---|
| Syntax | Violates language rules; program won’t run/compile | Missing parenthesis; misspelled keyword |
| Runtime | Occurs during execution; crashes the program | Dividing by zero; accessing out-of-bounds index |
| Logic | Program runs but produces incorrect results | Using < instead of ≤; off-by-one in loop |
| Overflow | Value exceeds the maximum storable number | Integer wrapping around to negative |
Abstraction Levels
Abstraction hides complexity at multiple levels:
- High-level language → hides machine code details
- Procedures/functions → hide implementation details
- Lists/data structures → hide individual element management
- APIs → hide how a service or library works internally
- Internet protocols → hide physical transmission details
2. DATA & INFORMATION (DAT)
Bits, Bytes & Number Systems
| Concept | Details |
|---|---|
| Bit | Smallest unit of data; value is 0 or 1 |
| Byte | 8 bits; can represent 2⁸ = 256 different values (0–255) |
| n bits represent | 2ⁿ unique values (e.g., 8 bits → 256, 16 bits → 65,536) |
| Binary (base-2) | Uses digits 0 and 1; each position is a power of 2 |
| Hexadecimal | Base-16 (0–9, A–F); often used to represent binary more compactly |
| Overflow | When a value exceeds the bits available; wraps around or causes error |
Binary ↔ Decimal Conversion (Must Know!)
-
Binary place values (right to left): 128 64 32 16 8 4 2 1 - Binary 10110101 → 128+0+32+16+0+4+0+1 = 181 (decimal)
- Decimal 45 → 32+8+4+1 = 101101 (binary)
-
Tip: 8-bit range = 0 to 255 Adding a bit doubles possible values - Tip: If a number requires more bits than available → OVERFLOW
Data Types & Representation
| Data Type | Stored As | Examples |
|---|---|---|
| Integer | Binary number | 42, -7, 0 |
| Float / Real | Approximation in binary (IEEE 754) | 3.14, -0.001 |
| Boolean | 1 bit (0 = false, 1 = true) | true, false |
| String / Text | ASCII or Unicode code points | “Hello”, ‘A’ |
| Color (RGB) | 3 bytes (R, G, B each 0–255) | Red = (255,0,0) |
| Sound | Sampled amplitude at intervals | MP3, WAV files |
| Image | Pixel grid of color values | PNG, JPEG, BMP |
Analog vs. Digital Data
| Analog | Digital |
|---|---|
| Continuous values (infinite precision) | Discrete values (finite, sampled) |
| Sound waves, temperature, light intensity | MP3, integers, pixel values |
| Cannot be stored directly by computer | Stored as binary patterns |
| Converted via ADC (Analog-to-Digital Converter) | Sampling rate affects quality |
Data Compression
| Type | Key Facts |
|---|---|
| Lossless | ALL original data recovered on decompression. Examples: ZIP, PNG, GIF. Used for text, code, executables. |
| Lossy | Some data permanently discarded. Examples: JPEG, MP3, MP4. Smaller file; quality reduced. CANNOT recover the original. |
| Run-Length Encoding | Lossless — replaces repeated values with count+value. e.g. AAABBC → 3A2B1C |
| Trade-off | Compression reduces file size (storage/bandwidth) at cost of time or quality |
Metadata & Data Analysis
- Metadata: data ABOUT data (e.g., file size, creation date, GPS location in a photo, author of a document)
- Metadata can reveal sensitive information even if the main content is private
- Data abstraction: using lists, databases, and structures to manage complex data sets
- Cleaning data: removing duplicates, fixing errors, handling missing values before analysis
- Visualizations (charts, graphs) reveal patterns; can also be used to mislead
- Correlation ≠ Causation: two variables moving together does not mean one causes the other
- Bias in data: if training/sample data is biased, conclusions and models will be too
3. ALGORITHMS & PROGRAMMING (AAP)
AP Pseudocode Reference — Assignment & I/O
AP Pseudocode Syntax
a ← expression // Assign value to variable a
a ← b // Assign value of b to a
DISPLAY(expression) // Output value to screen
INPUT() // Get input from user
a ← INPUT() // Store user input in a
AP Pseudocode — Arithmetic & Comparisons
| Operator | Meaning | Example / Notes |
|---|---|---|
| a + b | Addition | 3 + 4 → 7 |
| a - b | Subtraction | 10 - 3 → 7 |
| a * b | Multiplication | 2 * 5 → 10 |
| a / b | Division (real) | 7 / 2 → 3.5 |
| a MOD b | Remainder | 7 MOD 2 → 1 (use for even/odd) |
| a = b | Equal to (comparison) | NOT assignment in conditions |
| a ≠ b | Not equal to | a NOT EQUAL b |
| a < b, a > b | Less / Greater than | strict |
| a ≤ b, a ≥ b | Less/Greater or equal | inclusive |
AP Pseudocode — Boolean & Selection
AP Pseudocode Syntax
NOT condition // True if condition is false
cond1 AND cond2 // True only if BOTH true
cond1 OR cond2 // True if AT LEAST ONE true
IF (condition) // Simple conditional
{
<block>
}
IF (condition) // If-Else
{
<block1>
}
ELSE
{
<block2>
}
IF (a > 0) // Nested conditional example
{
IF (a > 100)
{ DISPLAY("big") }
ELSE
{ DISPLAY("small") }
}
AP Pseudocode — Iteration (Loops)
AP Pseudocode Syntax
REPEAT n TIMES // Count-controlled loop
{
<block>
}
REPEAT UNTIL (condition) // Condition-controlled loop (runs while condition is FALSE)
{
<block> // Executes at least ONCE (like do-while)
}
FOR EACH item IN list // Traversal loop
{
<block> // item takes each value in list sequentially
}
AP Pseudocode — Lists
AP Pseudocode Syntax
myList ← [1, 2, 3, 4] // Create list
myList[1] // Access FIRST element (AP CSP lists START AT INDEX 1!)
myList[i] ← value // Assign value to index i
INSERT(myList, i, value) // Insert value at index i; shifts elements right
APPEND(myList, value) // Add value to END of list
REMOVE(myList, i) // Remove element at index i; shifts elements left
LENGTH(myList) // Returns number of elements
FOR EACH item IN myList // Standard traversal pattern
{
DISPLAY(item)
}
AP Pseudocode — Procedures
AP Pseudocode Syntax
PROCEDURE myProc(param1, param2) // Define procedure with parameters
{
<block>
RETURN expression // Optional — sends value back to caller
}
result ← myProc(3, 7) // Call procedure and store return value
myProc(3, 7) // Call without capturing return value
// Parameters are LOCAL — changes don't affect original variables unless returned
Common Algorithm Patterns
Patterns You MUST Recognize & Write
SUM: total ← 0 | FOR EACH x IN list { total ← total + x }
COUNT: count ← 0 | FOR EACH x IN list { IF (condition) { count ← count + 1 } }
FIND MAX: max ← list[1] | FOR EACH x IN list { IF (x > max) { max ← x } }
FIND MIN: min ← list[1] | FOR EACH x IN list { IF (x < min) { min ← x } }
FILTER: result ← [] | FOR EACH x IN list { IF (condition) { APPEND(result, x) } }
SEARCH (linear): found ← false | FOR EACH x IN list { IF (x = target) { found ← true } }
Searching Algorithms
| ** | Linear Search vs Binary Search |
|---|---|
| Linear Search | Checks each element one-by-one from start to end. Works on ANY list (sorted or unsorted). O(n) worst case. |
| Binary Search | Cuts search space in HALF each step. Requires SORTED list. Much faster: O(log n). Mid = (low+high)/2. |
| When binary fails | List not sorted → binary search gives WRONG results. Always check sort requirement! |
| Binary search steps | 1) Find midpoint 2) If match → done 3) If target < mid → search left half 4) Else → search right half 5) Repeat |
Algorithm Efficiency & Complexity
| Complexity | Meaning & Example |
|---|---|
| O(1) — Constant | Same time regardless of input size. e.g., accessing list[3] |
| O(log n) — Logarithmic | Time grows slowly. e.g., binary search on 1M items ≈ 20 steps |
| O(n) — Linear | Time grows with input size. e.g., linear search, single traversal |
| O(n²) — Quadratic | Nested loops over same data. e.g., selection sort, comparing all pairs |
| Heuristic | Approximate solution when exact is too slow; may not be optimal but is reasonable |
| Undecidable Problem | No algorithm can ALWAYS determine YES/NO (e.g., Halting Problem). Not solvable. |
| Unsolvable Problem | No algorithm exists that solves it for ALL inputs in all cases |
Sorting Concepts (Conceptual — No Code Required)
- Selection Sort:Find the minimum, place it at start, repeat on remaining. O(n²).
- Insertion Sort:Build sorted portion one element at a time; insert each into correct position. O(n²) worst, O(n) best.
- AP exam tests UNDERSTANDING of how sorting works, not memorizing code
- Any correct sorting algorithm is equivalent in terms of correctness
Undecidability & Limits of Computing
The Halting Problem — Key Exam Concept
- Definition: No algorithm can determine for ALL programs whether they will halt (finish) or run forever.
- This is UNDECIDABLE — proven by Alan Turing.
- Implication: There are problems computers CANNOT solve, no matter how fast or advanced.
- An algorithm that loops forever is still an algorithm — it just never terminates.
- ★ Exam tip: ‘No algorithm can solve X for all inputs’ = undecidable problem
4. COMPUTING SYSTEMS & NETWORKS (CSN)
Hardware Basics
| Component | Function |
|---|---|
| CPU (Processor) | Executes instructions; performs arithmetic and logic |
| RAM (Memory) | Temporary storage for running programs; lost when powered off |
| Storage (HDD/SSD) | Permanent data storage; persists when powered off |
| Input Devices | Keyboard, mouse, microphone, camera — bring data IN |
| Output Devices | Monitor, printer, speakers — send data OUT |
| Network Interface | Hardware to connect to a network (Ethernet, Wi-Fi card) |
How the Internet Works
Key Internet Concepts
- Packet Switching: Data is broken into packets, each routed independently, reassembled at destination.
- Packets may take DIFFERENT paths and arrive OUT OF ORDER — protocols handle reassembly.
- Redundancy: Multiple paths exist between nodes; if one fails, data re-routes automatically.
- Fault Tolerance: The internet is designed to keep working even when parts fail.
- Scalability: The internet can grow (add nodes/connections) without redesigning the whole system.
- IP Address: Unique numerical label for every device on the internet (e.g., 192.168.1.1).
- IPv4 uses 32 bits (~4 billion addresses); IPv6 uses 128 bits (vastly more).
Network Protocols (Must Know All)
| Protocol | Purpose & Key Facts |
|---|---|
| IP (Internet Protocol) | Assigns addresses; routes packets between devices. Handles addressing only. |
| TCP (Transmission Control Protocol) | Ensures RELIABLE delivery: packets acknowledged, retransmitted if lost, delivered IN ORDER. |
| UDP (User Datagram Protocol) | Faster but UNRELIABLE: no acknowledgment; used for video streaming, gaming, VoIP. |
| HTTP / HTTPS | Application protocol for web pages. HTTPS = encrypted with TLS/SSL. |
| DNS (Domain Name System) | Translates human-readable names (google.com) to IP addresses. Like a phone book. |
| SMTP / IMAP / POP3 | Email protocols for sending (SMTP) and receiving (IMAP/POP3). |
| Wi-Fi / Bluetooth | Wireless physical layer protocols for local device communication. |
Internet Layers (Simplified)
| Layer | Role | Examples |
|---|---|---|
| Application | User-facing services | HTTP, DNS, SMTP, FTP |
| Transport | End-to-end communication | TCP, UDP |
| Internet | Addressing & routing | IP |
| Network Access | Physical transmission | Ethernet, Wi-Fi, fiber |
Bandwidth vs. Latency
| Term | Definition & Analogy |
|---|---|
| Bandwidth | Maximum data transferred per second (bits/s). Width of the pipe. Higher = more data. |
| Latency | Time delay for data to travel from sender to receiver (milliseconds). Length of the pipe. |
| Throughput | Actual data rate achieved (≤ bandwidth due to congestion, errors, overhead). |
| Trade-off | High bandwidth does NOT mean low latency. Satellite has huge bandwidth but high latency. |
Parallel & Distributed Computing
Parallel vs Sequential vs Distributed
- Sequential Computing: Tasks run one at a time, in order. Predictable but potentially slower.
- Parallel Computing: Multiple tasks run SIMULTANEOUSLY on multiple processors/cores. Speeds up suitable tasks.
- Distributed Computing: Tasks split across multiple computers/devices on a network (e.g., SETI@home, cloud computing).
- ★ KEY EXAM TRAPS:
- • Parallel is NOT always faster — overhead of splitting/merging can slow things down.
- • Only PARALLELIZABLE portions benefit — sequential parts remain bottlenecks (Amdahl’s Law concept).
- • Speedup = Sequential time / Parallel time (approximate formula for exam).
- • Some problems cannot be parallelized (each step depends on the previous result).
5. CYBERSECURITY & PRIVACY
Types of Attacks
| Attack | Description |
|---|---|
| Phishing | Deceptive emails/sites trick users into revealing credentials or installing malware. |
| Malware | Malicious software: viruses (self-replicate), ransomware (encrypts files for ransom), spyware. |
| Denial of Service (DoS) | Overwhelms a server with requests, making it unavailable to real users. |
| Distributed DoS (DDoS) | DoS using thousands of compromised computers (botnet). Much harder to stop. |
| SQL Injection | Attacker inserts malicious SQL code into a form input to access/corrupt a database. |
| Man-in-the-Middle | Attacker intercepts communication between two parties without their knowledge. |
| Social Engineering | Manipulating people (not systems) to reveal information. Phishing is one example. |
| Rogue Access Point | Fake Wi-Fi network created by attacker to intercept traffic. |
Security Methods & Defenses
| Defense | How It Works |
|---|---|
| Encryption | Transforms readable data (plaintext) into unreadable form (ciphertext). Only decrypted with key. |
| Symmetric Encryption | SAME key encrypts and decrypts. Fast; key must be securely shared. |
| Asymmetric Encryption (Public Key) | Public key encrypts; private key decrypts. Key pair; no need to share private key. Used in HTTPS. |
| Digital Signature | Proves authenticity and integrity; uses sender’s private key to sign. |
| SSL / TLS | Protocols that encrypt data in transit (used in HTTPS). Provides authentication + encryption. |
| Multi-Factor Authentication (MFA) | Requires 2+ factors: something you know (password), have (phone), or are (fingerprint). |
| Firewall | Monitors and filters incoming/outgoing network traffic based on security rules. |
| Antivirus / Anti-malware | Detects, quarantines, and removes malicious software. |
| Software Updates / Patches | Fix known vulnerabilities; critical for security. |
| Principle of Least Privilege | Users/programs get ONLY the permissions they need — nothing more. |
Privacy Concepts
- PII (Personally Identifiable Information):Data that identifies a person: name, SSN, address, email, phone, IP address.
- Data Privacy:Individuals have the right to control how their personal data is collected and used.
- Cookies:Small files stored by websites to track sessions and preferences.
- Third-Party Tracking:Advertisers track users across websites using embedded scripts/pixels.
- Data Broker:Companies that collect, aggregate, and sell personal data without direct user consent.
- Terms of Service:Legal agreements users accept; often grant companies broad data usage rights.
- FERPA / COPPA / GDPR:Laws protecting student records, children’s data, and EU citizen data respectively.
6. IMPACT OF COMPUTING (IOC)
Beneficial & Harmful Impacts
| Positive Impacts | Negative Impacts |
|---|---|
| Improved global communication | Privacy erosion / surveillance |
| Access to information & education | Cybercrime and identity theft |
| Medical advances / diagnostics | Automation displacing jobs |
| Scientific collaboration & modeling | Spread of misinformation |
| Accessibility tools (screen readers, etc.) | Environmental impact of data centers |
| Economic opportunity & e-commerce | Algorithmic bias and discrimination |
Equity & Digital Divide
Key Terms
- Digital Divide: Unequal access to technology (internet, devices, skills) across regions, incomes, and demographics.
- Causes: Cost of hardware/internet, lack of infrastructure, language barriers, disability access.
- Crowdsourcing: Distributed data/work collection from large online groups. Ex: Wikipedia, reCAPTCHA, citizen science.
- Open Source Software: Source code is publicly available; anyone can modify and distribute. Ex: Linux, Firefox.
- Proprietary Software: Source code is private; controlled by company. Ex: Windows, Photoshop.
- Creative Commons: Licensing that allows creators to specify how their work may be shared/used.
Intellectual Property & Legal Issues
- Copyright:Protects original creative works automatically upon creation. Infringement = illegal use without permission.
- Fair Use:Limited use of copyrighted material without permission (education, commentary, parody).
- Plagiarism:Using others’ work without attribution — unethical even if legal (e.g., public domain).
- Open Source License:Specifies how software may be used, modified, and distributed.
- Computing Innovation:Must specify a purpose; can be beneficial or harmful depending on use and access.
Algorithmic Bias & Ethics
- Bias enters AI/ML systems through biased training data, biased labels, or biased design choices
- Facial recognition has higher error rates for darker skin tones — documented bias
- Hiring algorithms trained on historical data can perpetuate past discrimination
- Programmers have ethical responsibilities for how their code affects users and society
- Unintended consequences: programs can have effects their creators never anticipated
Legal & Safe Computing Practices
- Computer Fraud and Abuse Act (CFAA):US law criminalizing unauthorized computer access.
- Safe Browsing:Verify URLs, avoid suspicious links, use HTTPS, keep software updated.
- Strong Passwords:Long, random, unique per site; use a password manager.
- Two-Factor Authentication:Adds a second layer beyond just a password.
- Citizen Responsibility:Report security vulnerabilities responsibly (responsible disclosure).
7. BOOLEAN LOGIC & EXPRESSIONS
Truth Tables (Must Memorize)
| A | B | NOT A | A AND B | A OR B | A XOR B |
|---|---|---|---|---|---|
| T | T | F | T | T | F |
| T | F | F | F | T | T |
| F | T | T | F | T | T |
| F | F | T | F | F | F |
Boolean Logic Key Rules
- AND: TRUE only when BOTH inputs are TRUE
- OR: TRUE when AT LEAST ONE input is TRUE
- NOT: Flips the value (TRUE→FALSE, FALSE→TRUE)
- XOR (exclusive or): TRUE when inputs are DIFFERENT (not tested directly but good to know)
- Short-circuit evaluation: In A AND B — if A is false, B is never checked.
- In A OR B — if A is true, B is never checked.
- De Morgan’s Laws (conceptual): NOT(A AND B) = NOT A OR NOT B
- NOT(A OR B) = NOT A AND NOT B
Conditional Logic Exam Patterns
AP Pseudocode Syntax
// Pattern 1: Compound condition
IF (x > 0 AND x < 100)
{ DISPLAY("in range") }
// Pattern 2: Negation
IF (NOT (score >= 70))
{ DISPLAY("failing") }
// Pattern 3: Equivalent to above
IF (score < 70)
{ DISPLAY("failing") }
// Pattern 4: Nested conditional
IF (age >= 18)
{
IF (registered = true)
{ DISPLAY("can vote") }
ELSE
{ DISPLAY("not registered") }
}
ELSE
{ DISPLAY("too young") }
8. CREATE PERFORMANCE TASK (CPT) — EXAM REQUIREMENTS
⚠ CRITICAL: CPT is 30% of your AP Score — Know Every Requirement
- You submit: a program you wrote + a written response (approx. 750 words) + a video of program running
- Your program must be written INDIVIDUALLY (collaboration allowed for ideation, not writing code for you)
- Time allocation: approximately 12 hours in class
Required Program Components (Must ALL be present)
| Requirement | What Graders Look For |
|---|---|
| Input | Program receives input from user, sensor, file, web query, or another program |
| Output | Program produces output visible to the user (display, audio, file, etc.) |
| List (or other collection) | Must USE a list to store multiple elements AND use list operations (not just declare it) |
| Procedure with Parameter | Student-defined procedure that takes at least one parameter AND uses it in the body |
| Algorithm with Sequence | Procedure body must have statements in order (sequencing) |
| Algorithm with Selection | Procedure body must include IF/ELSE or conditional logic |
| Algorithm with Iteration | Procedure body must include a loop (REPEAT, FOR EACH, WHILE, etc.) |
| Calls the Procedure | The defined procedure must actually be called somewhere in the program |
Written Response Rows (Scoring Rubric)
| Row | Topic | Key Points to Address |
|---|---|---|
| 1 | Program Purpose & Function | State the PURPOSE (why it exists, the problem it solves). Describe INPUT and OUTPUT. Demonstrate functionality via video. |
| 2 | Data Abstraction | Show the list. Explain what data is stored. Explain how the list MANAGES COMPLEXITY (what would be harder without it). |
| 3 | Managing Complexity | Explain how the list helps manage complexity. Name the list, what it stores, and WHY it’s necessary. |
| 4 | Procedural Abstraction | Identify the student-defined procedure. Describe what it does. Explain how it contributes to overall program functionality. |
| 5 | Algorithm Implementation | Describe the algorithm inside the procedure. Explain sequence, selection, AND iteration — all three must be present. |
| 6 | Testing | Describe TWO different calls to the procedure. State arguments used. Identify expected output/behavior. State the result. |
Common CPT Mistakes That Cost Points
- ✗ List is declared but never meaningfully used (must store AND retrieve data from list)
- ✗ Procedure has no PARAMETERS — must have at least one parameter that affects behavior
- ✗ Algorithm is missing selection OR iteration — need ALL THREE in the SAME procedure
- ✗ Procedure is not student-written (using only built-in library functions doesn’t count)
- ✗ Written response says ‘what’ but not ‘why’ — always explain purpose and effect
- ✗ Testing section only describes one test case — need TWO different calls with different arguments
- ✗ Program purpose described as ‘it runs’ — must state the problem being solved
- ✗ Video doesn’t show both input and output — record carefully
9. EXAM STRATEGIES & CRITICAL FACTS
Must-Know Exam Traps
These Are Tested Every Year
-
- AP CSP LISTS START AT INDEX 1 — not 0. list[1] is the FIRST element.
-
- Binary search REQUIRES a SORTED list — using it on unsorted data gives WRONG results.
-
- Lossy compression PERMANENTLY discards data — you CANNOT recover the original.
-
- Parallel computing is NOT always faster — overhead and non-parallelizable code can slow things down.
-
- REPEAT UNTIL runs the body FIRST, then checks condition (executes at least once).
-
- Correlation does NOT imply causation — two trends moving together ≠ one causes the other.
-
- The Internet was DESIGNED for fault tolerance — packets re-route around failures automatically.
-
- Metadata can reveal private information even when the main content is private.
-
- Adding more bits DOUBLES the number of values representable (2ⁿ).
-
- An undecidable problem has NO algorithm that solves it for ALL inputs — not just unsolved yet.
-
- HTTPS encrypts data in transit — HTTP does NOT.
-
- DNS translates domain names to IP addresses — it does NOT provide security.
-
- TCP guarantees delivery and ORDER; UDP does not — UDP is faster.
-
- Open-source software is NOT necessarily free (free as in freedom, not always free as in cost).
-
- Parameters are LOCAL — changes inside a procedure don’t affect variables outside (unless returned).
AP CSP Pseudocode Quick Reference Card
| Assignment & I/O | Control Flow | List Operations |
|---|---|---|
| a ← value | IF (cond) { } | list[i] |
| DISPLAY(expr) | IF / ELSE { } | INSERT(L,i,v) |
| a ← INPUT() | REPEAT n TIMES { } | APPEND(L,v) |
| a MOD b | REPEAT UNTIL(c) { } | REMOVE(L,i) |
| FOR EACH x IN L { } | LENGTH(L) |
Key Numbers & Facts to Memorize
| Fact | Value | Why It Matters |
|---|---|---|
| 1 byte | 8 bits | Fundamental unit of storage |
| n bits → values | 2ⁿ | e.g., 8 bits = 256 values |
| ASCII (basic) | 128 characters | 7-bit encoding; 0–127 |
| RGB color depth | 24 bits (3 × 8) | 16.7 million colors |
| IPv4 address | 32 bits | ≈ 4 billion unique addresses |
| IPv6 address | 128 bits | Vastly more addresses |
| AP list indexing | Starts at 1 | NOT 0 like most languages |
MCQ Strategy
- Read the ENTIRE question before looking at answers — trap answers often match partial readings
- Eliminate obviously wrong answers first, then compare remaining choices
- For pseudocode questions: TRACE the code manually with a simple example
- For algorithm questions: ask what happens with 0 elements, 1 element, and maximum elements
- For impact questions: look for the most DIRECT effect, not a secondary consequence
- For network/internet questions: remember the Internet was designed for FAULT TOLERANCE
- Time: 2 hours for 70 MCQ ≈ 1 min 42 sec per question — don’t get stuck; flag and return