FTCE Computer Science study materials
FTCE Computer Science study resources

FTCE Computer Science cheat sheet

FTCE Computer Science · Keep the key ideas within reach.

Quick reference

Computer Science Content Knowledge

  • Binary place values double leftward: 1, 2, 4, 8, 16, 32, 64, 128; 1101₂ = 8 + 4 + 1 = 13₁₀.

  • Hex digit = exactly 4 bits, so one byte always renders as two hex digits (255₁₀ = 11111111₂ = FF₁₆).

  • Two's complement: invert all bits and add 1 to negate; an n-bit signed range is −2^(n−1) to 2^(n−1) − 1.

  • Boolean identities: De Morgan gives ¬(A ∧ B) = ¬A ∨ ¬B and ¬(A ∨ B) = ¬A ∧ ¬B; XOR is 1 only when inputs differ.

  • Data structures by cost: array index O(1); balanced BST search O(log n); hash table average O(1), worst O(n) under collisions.

  • Stack is LIFO (push/pop), queue is FIFO (enqueue/dequeue); recursion uses the call stack, breadth-first search uses a queue.

  • Sorting: bubble/insertion/selection are O(n²); merge and heap sort are O(n log n); quicksort averages O(n log n), worst O(n²).

  • Abstraction, encapsulation, inheritance, and polymorphism are the four OOP pillars; overloading is compile-time, overriding is runtime dispatch.

  • Compiler translates the whole source to machine code before execution; interpreter executes statement by statement, so errors surface at runtime.

Quick reference

Computational Thinking and Problem Solving

  • Decomposition breaks a problem into subproblems; pattern recognition finds reusable regularities; abstraction removes detail; algorithm design orders steps.

  • Algorithm properties: finite (terminates), definite (unambiguous steps), has input/output, and is effective (each step is executable).

  • Linear search is O(n) on any list; binary search is O(log n) but requires a sorted array and random access.

  • Trace a loop by tabulating variable values per iteration; off-by-one errors show as one extra or one missing iteration.

  • Flowchart symbols: oval = start/end, parallelogram = input/output, rectangle = process, diamond = decision, arrow = control flow.

  • Pseudocode is language-neutral; convert it by mapping sequence to statements, selection to if/else or switch, iteration to for/while.

  • Recursive solution needs a base case and a recursive case that moves toward the base; missing base case causes stack overflow.

  • Big-O describes growth of the dominant term as input grows; constants and lower-order terms are dropped (3n² + 5n → O(n²)).

  • Test cases should cover normal input, boundary values, and invalid input; a boundary error often appears at the first or last element.

Quick reference

Programming and Software Development

  • Variable scope: local variables exist only inside their block; parameters are local; global/static variables persist for the program lifetime.

  • Pass by value copies the argument; pass by reference passes the address, so callee changes are visible to the caller.

  • Loop selection rule: use for when the iteration count is known, while when it depends on a condition, do-while when the body must run at least once.

  • Array indices are zero-based in Java, C, C++, and Python; accessing index equal to length throws an out-of-bounds error.

  • String comparison uses equals() in Java, not ==, which compares object references rather than character content.

  • Exception handling: try holds risky code, catch handles a thrown exception, finally always runs; unchecked exceptions need not be declared.

  • SDLC phases: requirements, design, implementation, testing, deployment, maintenance; maintenance typically consumes the largest share of lifetime cost.

  • Version control commits record snapshots; branches isolate work; merging combines histories and conflicts arise when the same lines changed.

  • Agile delivers working increments in short iterations with continuous feedback; waterfall sequences phases with heavy upfront specification.

Quick reference

Computing Systems

  • CPU cycle: fetch instruction from memory, decode it, execute it, store the result; the program counter holds the next address.

  • Memory hierarchy by speed and cost: registers, cache (L1/L2/L3), RAM, SSD/HDD; each lower level is larger and slower.

  • RAM is volatile and holds running programs; ROM is nonvolatile; secondary storage keeps data when power is off.

  • Operating system duties: process scheduling, memory management, file systems, device drivers, and user/security management.

  • Number storage: a signed 8-bit value spans −128 to 127; overflow wraps or errors when a result exceeds the representable range.

  • ASCII uses 7 bits for 128 characters; Unicode assigns code points for all scripts, and UTF-8 encodes them in 1–4 bytes.

  • Logic gates: AND outputs 1 only if both inputs are 1, OR if either is 1, NOT inverts, XOR if inputs differ; combine gates to build adders.

  • Machine cycle timing relates to clock speed; more cores allow parallel processes but do not automatically speed a single-threaded program.

Quick reference

Networks, and Impacts of Computing

  • OSI layers bottom-up: Physical, Data Link, Network, Transport, Session, Presentation, Application; TCP/IP collapses these to four.

  • IP addresses identify hosts; DNS resolves domain names to IP addresses; DHCP assigns addresses automatically.

  • TCP is connection-oriented and reliable with acknowledgments and retransmission; UDP is connectionless with lower overhead.

  • Private IPv4 ranges: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16; a /24 subnet masks 255.255.255.0 and yields 254 usable hosts.

  • HTTP/HTTPS run over TCP; HTTPS adds TLS encryption; port 80 is HTTP, 443 HTTPS, 25 SMTP, 53 DNS, 22 SSH.

  • Topologies: star fails gracefully per node but depends on the central switch; mesh offers redundant paths at higher cabling cost.

  • Security controls: encryption protects confidentiality, hashing verifies integrity, firewalls filter traffic, MFA strengthens authentication.

  • Computing impacts: automation shifts employment, digital divides limit access, and data collection raises privacy and consent questions.

  • Acceptable-use and IP law: copyright protects expression, patents protect inventions, and fair use is a limited, factor-based exception.

Quick reference

Computer Science Content Knowledge

  • Binary place values double leftward: 1, 2, 4, 8, 16, 32, 64, 128; 1101₂ = 8 + 4 + 1 = 13₁₀.

  • Hex digit = exactly 4 bits, so one byte always renders as two hex digits (255₁₀ = 11111111₂ = FF₁₆).

  • Two's complement: invert all bits and add 1 to negate; an n-bit signed range is −2^(n−1) to 2^(n−1) − 1.

  • Boolean identities: De Morgan gives ¬(A ∧ B) = ¬A ∨ ¬B and ¬(A ∨ B) = ¬A ∧ ¬B; XOR is 1 only when inputs differ.

  • Data structures by cost: array index O(1); balanced BST search O(log n); hash table average O(1), worst O(n) under collisions.

  • Stack is LIFO (push/pop), queue is FIFO (enqueue/dequeue); recursion uses the call stack, breadth-first search uses a queue.

  • Sorting: bubble/insertion/selection are O(n²); merge and heap sort are O(n log n); quicksort averages O(n log n), worst O(n²).

  • Abstraction, encapsulation, inheritance, and polymorphism are the four OOP pillars; overloading is compile-time, overriding is runtime dispatch.

  • Compiler translates the whole source to machine code before execution; interpreter executes statement by statement, so errors surface at runtime.

Quick reference

Computational Thinking and Problem Solving

  • Decomposition breaks a problem into subproblems; pattern recognition finds reusable regularities; abstraction removes detail; algorithm design orders steps.

  • Algorithm properties: finite (terminates), definite (unambiguous steps), has input/output, and is effective (each step is executable).

  • Linear search is O(n) on any list; binary search is O(log n) but requires a sorted array and random access.

  • Trace a loop by tabulating variable values per iteration; off-by-one errors show as one extra or one missing iteration.

  • Flowchart symbols: oval = start/end, parallelogram = input/output, rectangle = process, diamond = decision, arrow = control flow.

  • Pseudocode is language-neutral; convert it by mapping sequence to statements, selection to if/else or switch, iteration to for/while.

  • Recursive solution needs a base case and a recursive case that moves toward the base; missing base case causes stack overflow.

  • Big-O describes growth of the dominant term as input grows; constants and lower-order terms are dropped (3n² + 5n → O(n²)).

  • Test cases should cover normal input, boundary values, and invalid input; a boundary error often appears at the first or last element.

Quick reference

Programming and Software Development

  • Variable scope: local variables exist only inside their block; parameters are local; global/static variables persist for the program lifetime.

  • Pass by value copies the argument; pass by reference passes the address, so callee changes are visible to the caller.

  • Loop selection rule: use for when the iteration count is known, while when it depends on a condition, do-while when the body must run at least once.

  • Array indices are zero-based in Java, C, C++, and Python; accessing index equal to length throws an out-of-bounds error.

  • String comparison uses equals() in Java, not ==, which compares object references rather than character content.

  • Exception handling: try holds risky code, catch handles a thrown exception, finally always runs; unchecked exceptions need not be declared.

  • SDLC phases: requirements, design, implementation, testing, deployment, maintenance; maintenance typically consumes the largest share of lifetime cost.

  • Version control commits record snapshots; branches isolate work; merging combines histories and conflicts arise when the same lines changed.

  • Agile delivers working increments in short iterations with continuous feedback; waterfall sequences phases with heavy upfront specification.

Quick reference

Computing Systems

  • CPU cycle: fetch instruction from memory, decode it, execute it, store the result; the program counter holds the next address.

  • Memory hierarchy by speed and cost: registers, cache (L1/L2/L3), RAM, SSD/HDD; each lower level is larger and slower.

  • RAM is volatile and holds running programs; ROM is nonvolatile; secondary storage keeps data when power is off.

  • Operating system duties: process scheduling, memory management, file systems, device drivers, and user/security management.

  • Number storage: a signed 8-bit value spans −128 to 127; overflow wraps or errors when a result exceeds the representable range.

  • ASCII uses 7 bits for 128 characters; Unicode assigns code points for all scripts, and UTF-8 encodes them in 1–4 bytes.

  • Logic gates: AND outputs 1 only if both inputs are 1, OR if either is 1, NOT inverts, XOR if inputs differ; combine gates to build adders.

  • Machine cycle timing relates to clock speed; more cores allow parallel processes but do not automatically speed a single-threaded program.

Quick reference

Networks, and Impacts of Computing

  • OSI layers bottom-up: Physical, Data Link, Network, Transport, Session, Presentation, Application; TCP/IP collapses these to four.

  • IP addresses identify hosts; DNS resolves domain names to IP addresses; DHCP assigns addresses automatically.

  • TCP is connection-oriented and reliable with acknowledgments and retransmission; UDP is connectionless with lower overhead.

  • Private IPv4 ranges: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16; a /24 subnet masks 255.255.255.0 and yields 254 usable hosts.

  • HTTP/HTTPS run over TCP; HTTPS adds TLS encryption; port 80 is HTTP, 443 HTTPS, 25 SMTP, 53 DNS, 22 SSH.

  • Topologies: star fails gracefully per node but depends on the central switch; mesh offers redundant paths at higher cabling cost.

  • Security controls: encryption protects confidentiality, hashing verifies integrity, firewalls filter traffic, MFA strengthens authentication.

  • Computing impacts: automation shifts employment, digital divides limit access, and data collection raises privacy and consent questions.

  • Acceptable-use and IP law: copyright protects expression, patents protect inventions, and fair use is a limited, factor-based exception.