ASSEB HS Computer Science and Application cheat sheet
ASSEB HS Computer Science and Application · Keep the key ideas within reach.
Computer Systems and Architecture
Von Neumann cycle: fetch (PC to MAR, memory to MDR), decode, execute, then increment PC or jump; data and instructions share one memory.
CPU time = instruction count × CPI × clock period; clock rate = 1 / clock period, so halving clock period halves CPU time for fixed CPI.
Speedup from pipelining is bounded by pipeline depth; hazards are structural (resource conflict), data (dependency), and control (branch).
Memory hierarchy from fastest to slowest: registers, cache (L1/L2/L3), main memory (RAM), secondary storage; each level trades speed for capacity and cost per bit.
Cache hit rate = hits / (hits + misses); average access time = hit time + miss rate × miss penalty.
RISC favours fixed-length instructions and many registers; CISC favours variable-length, multi-step instructions; both use the same fetch-decode-execute cycle.
Amdahl's law: speedup = 1 / ((1 − p) + p/s), where p is the fraction improved and s is the improvement factor.
Interrupts suspend the current process, save state, run a handler, then restore; polling instead repeatedly checks a status register.
Memory-mapped I/O places device registers in the address space, so ordinary load/store instructions access devices.
Data Representation and Digital Logic
n bits encode 2^n distinct values; unsigned range is 0 to 2^n − 1, two's complement range is −2^(n−1) to 2^(n−1) − 1.
Two's complement negation: invert all bits and add 1; the sign bit has weight −2^(n−1), all others positive.
Hex digit = 4 bits; convert binary to hex by grouping from the radix point outward, padding the outer group with zeros.
AND outputs 1 only if both inputs are 1; OR outputs 1 if any input is 1; XOR outputs 1 only for differing inputs; NOT inverts.
De Morgan: NOT(A AND B) = (NOT A) OR (NOT B); NOT(A OR B) = (NOT A) AND (NOT B).
Half adder: sum = A XOR B, carry = A AND B; a full adder also takes carry-in and uses two half adders plus an OR gate.
Floating point (IEEE 754 single) = 1 sign bit, 8 exponent bits with bias 127, 23 mantissa bits; value = (−1)^s × 1.mantissa × 2^(exponent−127).
Parity detects an odd number of flipped bits but cannot correct; Hamming code adds overlapping parity bits to locate and correct a single-bit error.
ASCII uses 7 bits (128 codes); Unicode assigns code points and UTF-8 encodes them in 1–4 bytes, ASCII-compatible for the first 128.
Programming Fundamentals
A variable is a named storage location with a type, scope and lifetime; a constant is assigned once and cannot be reassigned.
Value parameters pass a copy; reference parameters pass an alias, so callee changes are visible to the caller.
Local variables live on the call stack and vanish on return; global/static variables persist for the program's lifetime.
Short-circuit evaluation: A AND B skips B if A is false; A OR B skips B if A is true.
Iteration (for/while) repeats while a condition holds; recursion calls the same function with a smaller input and needs a base case to terminate.
A compiler translates the whole source to machine code before running; an interpreter executes statements one at a time; both report syntax errors before or during execution.
Exception handling uses try/catch/finally: the catch block runs on a thrown exception, finally runs regardless of outcome.
Operator precedence: parentheses, then unary, then multiplicative, then additive, then relational, then logical AND, then logical OR, then assignment.
Algorithms and Problem Solving
Big-O upper bounds growth of runtime; O(1) < O(log n) < O(n) < O(n log n) < O(n²) < O(2^n) < O(n!).
Binary search requires a sorted array, halves the range each step, and runs in O(log n); linear search is O(n) and needs no order.
Bubble, insertion and selection sort are O(n²); merge sort and heap sort are O(n log n); quicksort averages O(n log n) but worst-case O(n²).
Merge sort needs O(n) extra space; quicksort is in-place but not stable; stability preserves the relative order of equal keys.
Breadth-first search uses a queue and finds shortest paths in unweighted graphs; depth-first search uses a stack or recursion.
Dijkstra's algorithm finds shortest paths with non-negative weights; negative edges require Bellman-Ford.
Dynamic programming stores overlapping subproblem results (memoisation or tabulation); greedy algorithms take locally best choices and need a proof of optimality.
Tractable problems are solvable in polynomial time (class P); NP problems have polynomial-time verifiers; NP-complete problems are the hardest in NP.
A recursive algorithm's cost satisfies a recurrence; the master theorem solves T(n) = aT(n/b) + f(n) by comparing f(n) with n^(log_b a).
Data Structures
Array: O(1) index access, O(n) insert/delete in the middle, fixed contiguous storage; a dynamic array doubles capacity to amortise growth.
Linked list: O(1) insert/delete given a node reference, O(n) search, no random access; a doubly linked list adds a previous pointer.
Stack is LIFO (push/pop at top); queue is FIFO (enqueue at rear, dequeue at front); a deque allows both ends.
Hash table average lookup is O(1); collisions are handled by chaining or open addressing, and the load factor drives resizing.
Binary search tree: in-order traversal yields sorted order; search/insert/delete are O(h), which degrades to O(n) when unbalanced.
AVL and red-black trees self-balance to keep height O(log n); a heap is a complete tree with parent ≥ children (max-heap) supporting O(log n) insert and O(1) peek.
Graph representations: adjacency matrix uses O(V²) space and O(1) edge lookup; adjacency list uses O(V + E) space and suits sparse graphs.
Trie stores strings by character edges; lookup time is O(length of key) regardless of the number of stored keys.
Networks and the Internet
OSI layers top-down: Application, Presentation, Session, Transport, Network, Data Link, Physical; TCP/IP collapses these to Application, Transport, Internet, Link.
TCP is connection-oriented with handshake, acknowledgements, retransmission and ordering; UDP is connectionless with no delivery guarantee.
IPv4 addresses are 32 bits; IPv6 addresses are 128 bits; a /n prefix leaves 32 − n host bits, so 2^(32−n) − 2 usable hosts.
Private IPv4 ranges: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16; NAT translates these to a public address.
DNS resolves names to IP addresses; DHCP assigns addresses automatically; ARP maps IP to MAC on a local network.
HTTP is stateless request/response over TCP; HTTPS adds TLS encryption; status codes 2xx success, 3xx redirect, 4xx client error, 5xx server error.
Switch forwards frames by MAC within a LAN; router forwards packets by IP between networks; a firewall filters by address, port or protocol.
Bandwidth is capacity in bits per second; latency is delay in milliseconds; throughput is actual delivered rate, never exceeding bandwidth.
Databases and Information Management
Relational model: tables (relations) of rows (tuples) and columns (attributes); a primary key uniquely identifies a row; a foreign key references another table's primary key.
ACID: Atomicity (all or nothing), Consistency (valid states), Isolation (concurrent transactions do not interfere), Durability (committed data survives failure).
SQL categories: DDL (CREATE, ALTER, DROP), DML (SELECT, INSERT, UPDATE, DELETE), DCL (GRANT, REVOKE).
SELECT clauses evaluate logically as FROM, WHERE, GROUP BY, HAVING, SELECT, ORDER BY; WHERE filters rows, HAVING filters groups.
Joins: INNER returns matching rows only; LEFT/RIGHT keep unmatched rows from one side with NULLs; FULL keeps both; CROSS is the Cartesian product.
Normalisation: 1NF removes repeating groups, 2NF removes partial dependencies on part of a composite key, 3NF removes transitive dependencies on non-key attributes.
Aggregate functions COUNT, SUM, AVG, MIN, MAX collapse rows; COUNT(*) counts rows, COUNT(column) skips NULLs.
Indexes speed up lookups and joins but cost space and slow down writes; a clustered index fixes the physical row order.
Software Engineering and System Development
Waterfall runs sequential phases with fixed requirements; agile uses short iterations, working software and continuous feedback.
SDLC phases: requirements, design, implementation, testing, deployment, maintenance; maintenance usually consumes the largest share of lifetime cost.
Testing levels: unit (single component), integration (interfaces), system (whole system), acceptance (against user needs); regression re-runs tests after changes.
Black-box testing uses inputs and outputs without code knowledge; white-box testing uses code structure and aims for statement or branch coverage.
Version control records commits; branches isolate work; a merge combines histories and may produce conflicts needing manual resolution.
UML class diagrams show classes, attributes, operations and relationships (association, inheritance, composition); sequence diagrams show message order over time.
Cohesion measures how related a module's responsibilities are (high is good); coupling measures dependency between modules (low is good).
A design pattern names a reusable solution, e.g. Observer for event notification, Factory for object creation, Singleton for one shared instance.
Security, Ethics, and Societal Impact of Computing
CIA triad: confidentiality (only authorised readers), integrity (data unaltered), availability (accessible when needed).
Symmetric encryption uses one shared key (fast, key distribution problem); asymmetric uses a public/private pair (slow, solves key exchange).
Hashing is one-way and collision-resistant; salting adds random data per password so identical passwords hash differently.
Digital signature = hash of message encrypted with sender's private key; verifies integrity and origin, not confidentiality.
Attack types: phishing (deceptive messages), SQL injection (unvalidated input altering queries), DDoS (flooding), man-in-the-middle (interception), malware (virus, worm, trojan, ransomware).
Prevention: parameterised queries against injection, input validation, least privilege, multi-factor authentication, patching, encryption at rest and in transit.
Ethics frameworks: consequentialism judges by outcomes, deontology by duties and rules; professional codes require honesty, competence and public safety.
Legal instruments: copyright protects expression, patents protect inventions, trademarks protect branding; data protection laws (e.g. GDPR) require lawful basis, consent and breach notification.
Programming Fundamentals (Control and Data)
Boolean operators: AND is true only if both operands are true; OR is false only if both are false; NOT reverses truth value.
A while loop may execute zero times; a do-while loop executes the body at least once before testing the condition.
A for loop has initialisation, condition and update; the loop variable is local to the loop in most modern languages.
Array indices usually start at 0, so the last valid index of an array of length n is n − 1.
String concatenation joins sequences; comparison checks content equality, not reference identity, in languages such as Java (equals) and Python (==).
Type conversion: implicit (widening, safe) versus explicit cast (narrowing, may lose data, e.g. float to int truncates).
A function signature is name plus parameter types; overloading allows several functions with the same name but different signatures.
Scope rules: a block-scoped variable is invisible outside its block; shadowing hides an outer variable with an inner one of the same name.
Data Structures (Operations and Costs)
Stack applications: expression evaluation, undo history, function call management, depth-first search.
Queue applications: print spooling, task scheduling, breadth-first search, buffering data streams.
Priority queue: extract-min/max in O(log n) with a binary heap; used in Dijkstra and Huffman coding.
Linked list insertion at the head is O(1); insertion at a known node is O(1); finding that node is O(n).
Binary heap stored in an array: children of index i are 2i + 1 and 2i + 2; parent is floor((i − 1) / 2).
Hash table worst case is O(n) when all keys collide; a good hash function spreads keys uniformly and resizing keeps the load factor low.
Tree traversals: pre-order (root, left, right) copies a tree; in-order (left, root, right) sorts a BST; post-order (left, right, root) deletes a tree.
Set operations: union, intersection, difference; a set stores unique elements and typically offers O(1) average membership testing.
Algorithms (Search, Sort, Complexity)
Linear search examines up to n items, O(n); binary search examines at most ceil(log2(n + 1)) items on a sorted array.
Insertion sort is O(n²) worst case but O(n) on nearly sorted data and is stable and in-place.
Selection sort performs exactly n(n − 1)/2 comparisons regardless of input order and is not stable in its usual form.
Merge sort divides, sorts halves recursively, then merges in O(n); total O(n log n) time and O(n) space.
Quicksort partitions around a pivot; a poor pivot choice on sorted data causes O(n²); randomised pivots mitigate this.
Counting sort runs in O(n + k) for integer keys in range k and is not comparison-based.
Algorithm correctness needs termination, partial correctness and a loop or recursion invariant proving the result.
Space complexity counts auxiliary memory: in-place algorithms use O(1) extra space; recursion uses O(depth) stack space.
Networks (Protocols and Addressing)
Port numbers identify services: 20/21 FTP, 22 SSH, 25 SMTP, 53 DNS, 80 HTTP, 443 HTTPS; ports 0–1023 are well known.
TCP three-way handshake: SYN, SYN-ACK, ACK; connection close uses FIN/ACK exchanges.
IP is best-effort and connectionless; TCP adds reliability, flow control and congestion control on top.
Subnet mask 255.255.255.0 equals /24; the network address has all host bits 0 and the broadcast address has all host bits 1.
MAC addresses are 48-bit link-layer identifiers; IP addresses are logical and change with network attachment.
DNS record types: A (IPv4), AAAA (IPv6), CNAME (alias), MX (mail), NS (name server), TXT (text/verification).
Latency components: propagation (distance/speed), transmission (size/bandwidth), processing and queuing delay.
Wireless security: WPA2/WPA3 encrypt traffic; an open network exposes data to interception on the local link.
Databases (SQL and Design)
SELECT DISTINCT removes duplicate rows; ORDER BY sorts ascending by default and DESC reverses it.
GROUP BY groups rows sharing a value; aggregate functions then apply per group; HAVING filters after aggregation.
NULL is unknown, not zero or empty; comparisons with NULL yield unknown, so use IS NULL and IS NOT NULL.
UNIQUE constrains a column to distinct values; NOT NULL forbids missing values; CHECK enforces a condition; a table has at most one primary key.
A view is a stored query presenting a virtual table; it can restrict columns and simplify complex joins.
A transaction ends with COMMIT (persist) or ROLLBACK (undo); isolation levels trade consistency against concurrency.
Entity-relationship modelling: entities become tables, attributes become columns, many-to-many relationships become junction tables.
Referential integrity forbids a foreign key value that has no matching primary key, unless the constraint allows NULL.
Software Engineering (Process and Quality)
Requirements are functional (what the system does) or non-functional (performance, usability, security, reliability).
A use case describes an actor, a goal and a main success scenario with alternative flows.
Test-driven development writes a failing test, then code to pass it, then refactors; it drives design from tests.
Code review and pair programming are static techniques that find defects before execution; testing is dynamic.
Continuous integration merges and builds frequently, running automated tests on every change.
Estimation and tracking use story points or time boxes; a burndown chart shows remaining work against time.
Refactoring improves internal structure without changing external behaviour; it reduces technical debt.
Deployment strategies: big-bang replaces everything at once; canary and blue-green reduce risk by shifting traffic gradually.
Security (Cryptography and Threats)
AES and DES are symmetric block ciphers; RSA and elliptic-curve are asymmetric; TLS combines asymmetric key exchange with symmetric session encryption.
Caesar cipher shifts letters by a fixed amount and is broken by frequency analysis; substitution ciphers map letters arbitrarily and are also frequency-analysable.
A block cipher mode such as CBC chains blocks with an IV; ECB encrypts identical blocks identically and leaks patterns.
Password storage uses a slow salted hash (bcrypt, Argon2, PBKDF2), never plaintext or fast unsalted hashes.
SQL injection defence: parameterised queries or prepared statements; escaping alone is fragile.
Cross-site scripting defence: output encoding and input validation; CSRF defence: per-request tokens and SameSite cookies.
Firewalls filter packets by address/port; intrusion detection systems flag suspicious patterns; antivirus matches known signatures or behaviour.
Social engineering exploits trust, not technical flaws; verification procedures and staff training are the primary controls.
Ethics and Societal Impact (Law and Access)
Accessibility: WCAG principles are perceivable, operable, understandable and robust; alt text, captions and keyboard navigation are common requirements.
Digital divide refers to unequal access to devices, connectivity and skills; it affects education, employment and civic participation.
Algorithmic bias arises when training data or design encodes historical inequity; mitigation includes diverse data and auditing outcomes.
Automation shifts employment rather than simply eliminating it; reskilling and social protection are policy responses.
Privacy principles: data minimisation, purpose limitation, storage limitation, accuracy, and user rights of access and erasure.
Intellectual property: copyright protects code as written expression; open-source licences (GPL, MIT, Apache) define reuse conditions.
Professional responsibility: engineers should report safety risks, avoid conflicts of interest and refuse work whose harm outweighs benefit.
Environmental impact: data centres consume electricity and water; efficiency measures include consolidation, cooling optimisation and renewable power.
Data Representation (Numbers, Text, Compression)
Binary to decimal: sum each bit times 2^position, counting positions from 0 at the rightmost bit.
Signed magnitude has two zeros (+0 and −0); two's complement has one zero and a wider negative range, so hardware uses it.
Overflow occurs when a result exceeds the representable range; for n-bit two's complement, adding two positives can set the sign bit.
Binary addition rules: 0+0=0, 0+1=1, 1+1=0 carry 1, 1+1+1=1 carry 1.
Character encoding: ASCII (7-bit), extended ASCII (8-bit, 256 codes), Unicode code points, UTF-8 variable length.
Lossless compression (ZIP, PNG, FLAC) preserves exact data; lossy compression (JPEG, MP3) discards detail to reduce size.
Run-length encoding replaces repeated runs with a count and value; it is effective on data with long runs, poor on random data.
Sampling and quantisation convert analogue to digital: sampling rate sets time resolution; bit depth sets amplitude resolution.
Digital Logic (Circuits and Design)
Truth tables list every input combination and the corresponding output; with n inputs there are 2^n rows.
A NAND gate is universal: NOT, AND, OR and XOR can all be built from NAND gates alone.
Karnaugh maps group adjacent 1s in powers of two (1, 2, 4, 8) to simplify Boolean expressions; wrap-around and edges count as adjacent.
Sum-of-products builds an AND term per 1-row and ORs them; product-of-sums builds an OR term per 0-row and ANDs them.
A multiplexer selects one of 2^n inputs using n select lines; a decoder activates one of 2^n outputs from an n-bit input.
A flip-flop stores one bit; an SR latch is level-sensitive, a D flip-flop samples on a clock edge, and registers are banks of flip-flops.
A finite state machine has states, inputs, transitions and outputs; Moore outputs depend on state, Mealy outputs on state and input.
Combinational circuits have no memory and outputs depend only on current inputs; sequential circuits include state held in flip-flops.
Computer Systems (Operating Systems)
A process is a program in execution with its own address space; a thread shares the process address space and has its own stack and registers.
Scheduling policies: first-come first-served (convoy effect), shortest job first (optimal average wait, needs prediction), round robin (time slice), priority.
Context switching saves one process's state and restores another's; it has overhead and does no useful user work.
Deadlock requires mutual exclusion, hold and wait, no preemption and circular wait; breaking any one condition prevents it.
Virtual memory maps virtual to physical addresses via page tables; a page fault loads a missing page from disk.
Thrashing is excessive paging caused by too little physical memory per process; reducing multiprogramming or adding memory helps.
File systems organise storage into blocks and directories; journaling records metadata changes to speed recovery after a crash.
Paging divides memory into fixed-size pages and frames; segmentation uses variable-size logical segments and can suffer external fragmentation.
Programming (Data Types and Structures)
Primitive types store single values (int, float, char, boolean); composite types combine values (array, record, class).
Integer division truncates toward zero in many languages; modulo returns the remainder and has the sign of the dividend in C-family languages.
A record (struct) groups named fields of possibly different types; an array groups elements of one type by index.
Immutability means a value cannot change after creation; immutable objects are safe to share between threads.
Pass-by-value copies the argument; for objects the value copied may be a reference, so the object's contents can still be mutated.
Type checking: static at compile time (Java, C) versus dynamic at runtime (Python, JavaScript); strong typing forbids implicit incompatible conversions.
A two-dimensional array is indexed as [row][column]; row-major layout stores a row's elements contiguously.
Enumerated types define a fixed set of named constants, improving readability and preventing invalid values.
Algorithms (Graphs and Problem Solving)
A graph has vertices and edges; directed edges have direction, weighted edges carry costs; a tree is a connected acyclic graph with V − 1 edges.
Traversal of a graph needs a visited set; without it, cycles cause infinite loops.
Topological sort orders tasks so every dependency precedes its dependents; it exists only for directed acyclic graphs.
Minimum spanning tree: Kruskal sorts edges and uses union-find; Prim grows from a start vertex; both are O(E log V) with suitable structures.
Shortest path in an unweighted graph uses BFS; weighted non-negative uses Dijkstra; all-pairs uses Floyd-Warshall in O(V³).
A heuristic search such as A* uses an estimate to guide exploration and is complete and optimal if the heuristic is admissible.
Problem-solving steps: understand the problem, identify inputs/outputs, design an algorithm, trace it on examples, then implement and test.
Decomposition breaks a problem into subproblems; abstraction hides irrelevant detail and names the essential interface.
Networks (Architecture and Services)
Client-server centralises resources and control; peer-to-peer distributes them and scales without a central server but complicates trust.
A LAN covers a small area, a WAN spans large distances, and the internet is a network of networks using the TCP/IP suite.
Packet switching splits data into packets routed independently; circuit switching reserves a path for the whole session.
Ethernet is the dominant wired LAN standard; Wi-Fi (IEEE 802.11) is the wireless equivalent; both use MAC addressing.
Cloud service models: IaaS provides virtual machines, PaaS provides a runtime platform, SaaS provides finished applications.
A VPN creates an encrypted tunnel over a public network, giving remote users access as if on the private network.
The domain name system is hierarchical: root servers, top-level domain servers, authoritative servers, with caching at resolvers.
Quality of service prioritises traffic classes so latency-sensitive flows such as voice are not starved by bulk transfers.
Databases (Models and Integrity)
Flat-file storage repeats data and causes inconsistency; a database management system centralises data and enforces constraints.
Data redundancy wastes space and risks update anomalies; normalisation reduces redundancy by splitting tables.
Denormalisation deliberately reintroduces redundancy to speed reads, at the cost of write complexity.
A candidate key is any minimal unique identifier; one candidate key is chosen as the primary key and the rest become alternate keys.
A composite key uses two or more columns together; a surrogate key is a system-generated identifier such as an auto-increment number.
Cardinality: one-to-one, one-to-many, many-to-many; a many-to-many relationship needs a linking table with two foreign keys.
Concurrency control uses locks or timestamps; a lost update occurs when two transactions overwrite each other's changes.
Backup and recovery: full backups copy everything, incremental copies changes since the last backup, and a transaction log enables point-in-time recovery.
Software Engineering (Modelling and Testing)
A data flow diagram shows processes, data stores, external entities and data flows; it does not show control flow or timing.
A state transition diagram models states and events; it suits reactive systems such as ATMs and vending machines.
Boundary value analysis tests at the edges of valid ranges (min−1, min, max, max+1); equivalence partitioning tests one value per class.
A test case specifies inputs, preconditions and expected outputs; a test oracle decides pass or fail.
Statement coverage measures executed statements; branch coverage measures executed decision outcomes and is stronger.
A defect is a flaw in the artefact; a failure is an observable deviation at runtime; a fault is the cause of a failure.
An MVP delivers the smallest feature set that tests a hypothesis with real users, then iterates.
Documentation types: user documentation explains operation; technical documentation records design and interfaces for maintainers.
Security (Access Control and Risk)
Authentication verifies identity; authorisation decides permissions; accounting (auditing) records what was done.
Authentication factors: something you know (password), something you have (token), something you are (biometric); MFA combines different types.
Access control models: discretionary (owner grants), mandatory (labels and clearance), role-based (permissions by job role).
Least privilege grants only the permissions needed for a task; separation of duties prevents one person from completing a sensitive action alone.
Risk = likelihood × impact; treatment options are avoid, reduce, transfer (insurance) and accept.
Defence in depth layers controls so a single failure does not compromise the whole system.
A zero-day exploits an unknown vulnerability; patching and monitoring reduce exposure but cannot prevent all zero-days.
Incident response phases: preparation, detection, containment, eradication, recovery, lessons learned.
Ethics (Professional and Social Issues)
Informed consent requires that users understand what data is collected, why, and how to withdraw.
Surveillance trade-offs pit public safety against privacy; proportionality requires measures be necessary and not excessive.
Whistleblowing is disclosure of wrongdoing; protections vary, and internal reporting is usually the first step.
Open data publishes datasets for reuse; anonymisation must resist re-identification through linkage with other datasets.
Net neutrality is the principle that ISPs treat all traffic equally without blocking or paid prioritisation.
Intellectual honesty in computing includes not plagiarising code, citing sources and disclosing limitations of results.
Universal access design benefits users with disabilities and situational limitations, such as bright screens or noisy environments.
Sustainability includes e-waste recycling, energy-efficient algorithms and extending device lifespans.
Architecture (Instruction Sets and Performance)
Instruction set categories: data transfer (load/store), arithmetic/logic, control flow (branch/jump), and I/O.
Addressing modes: immediate (value in instruction), direct (address in instruction), indirect (address stored in memory), indexed (base plus offset).
Registers include the program counter, instruction register, memory address register, memory data register and accumulator.
The fetch-execute cycle repeats; pipelining overlaps stages so several instructions are in flight, limited by hazards.
A branch predictor guesses branch outcomes to keep the pipeline full; a misprediction flushes the pipeline and costs cycles.
Clock speed alone does not determine performance; CPI and instruction count matter, so a lower-clock CPU may be faster.
Cores allow parallel execution of threads but shared resources and synchronisation limit the speedup (Amdahl's law).
Embedded systems trade performance for power, size and cost, often using microcontrollers with integrated memory and I/O.
Data Representation (Binary Arithmetic and Logic)
Binary subtraction uses two's complement: A − B = A + (NOT B + 1), discarding any final carry out of the sign position.
Left shift by k multiplies an unsigned value by 2^k; right shift divides by 2^k, discarding the remainder.
Logical shift fills with zeros; arithmetic shift preserves the sign bit, so it correctly halves negative two's complement values.
Bitwise AND masks bits, OR sets bits, XOR toggles bits; these operations implement flags and permissions.
Overflow in signed addition occurs when two operands of the same sign produce a result of the opposite sign.
BCD encodes each decimal digit in four bits; it wastes codes but simplifies decimal display.
Floating point cannot represent most decimals exactly, so comparing floats requires a tolerance rather than equality.
Boolean algebra identities: A AND 1 = A, A AND 0 = 0, A OR 0 = A, A OR 1 = 1, A XOR A = 0, A AND NOT A = 0.
Programming (Modularity and Errors)
A procedure performs an action and returns nothing; a function returns a value; both are subprograms with parameters and a body.
Modularity splits a program into units with clear interfaces; it improves reuse, testing and maintainability.
Syntax errors violate grammar and are caught before execution; logic errors produce wrong results and require testing to find.
Runtime errors occur during execution, such as division by zero or null dereference; exception handling can recover.
A stack trace lists the call chain at the point an error occurred, with file and line information.
Debugging strategies: reproduce, isolate with breakpoints or print statements, form a hypothesis, fix and re-test.
Defensive programming validates inputs and asserts invariants; assertions are usually disabled in production builds.
An API is a contract of names, parameters and return values; changing it breaks callers unless backward compatible.
Algorithms (Complexity and Correctness)
Big-O ignores constants and lower-order terms, so 3n² + 5n + 7 is O(n²).
Big-Omega is a lower bound, Big-Theta a tight bound; average case requires a probability assumption over inputs.
Nested loops over n items give O(n²); halving the range each iteration gives O(log n); a loop over n with an inner log step gives O(n log n).
Recursion depth equals the number of pending calls; deep recursion risks stack overflow.
Memoisation caches results by argument; tabulation fills a table bottom-up and avoids recursion overhead.
A greedy algorithm is correct when the problem has the greedy-choice property and optimal substructure.
Halting problem: no general algorithm decides whether an arbitrary program halts, so some problems are undecidable.
Heuristics and approximation algorithms give good but not guaranteed-optimal answers for intractable problems.
Networks (Security and Web)
TLS handshake: client hello, server certificate and key exchange, session keys agreed, then encrypted application data.
A certificate binds a public key to a domain and is signed by a certificate authority; browsers reject untrusted or expired certificates.
HTTP methods: GET retrieves, POST submits data in the body, PUT replaces, PATCH partially updates, DELETE removes.
Cookies store state across stateless HTTP requests; the Secure flag sends them only over HTTPS and HttpOnly blocks script access.
REST uses resources identified by URLs and standard methods; GraphQL exposes one endpoint with client-specified queries.
Same-origin policy restricts scripts from reading another origin's data; CORS headers relax it for approved origins.
A proxy forwards requests on behalf of clients; a reverse proxy sits in front of servers for load balancing and caching.
Bandwidth-delay product = bandwidth × round-trip time; it bounds the data in flight and affects TCP throughput.
Databases (Queries and Transactions)
INNER JOIN returns rows satisfying the join condition; LEFT JOIN keeps all left rows and fills unmatched right columns with NULL.
UNION combines result sets and removes duplicates; UNION ALL keeps duplicates and is usually faster.
Subqueries can appear in WHERE, FROM or SELECT; EXISTS tests whether a correlated subquery returns any row.
Aggregate queries without GROUP BY return one row; selecting a non-aggregated column alongside aggregates without GROUP BY is invalid in strict SQL.
A transaction's isolation level controls anomalies: dirty read, non-repeatable read, phantom read; higher isolation reduces anomalies but lowers concurrency.
ACID durability is achieved by writing to a log before committing; recovery replays committed transactions.
A stored procedure is a named, precompiled set of SQL statements; a trigger fires automatically on insert, update or delete.
Query optimisation uses indexes, selective predicates and avoiding functions on indexed columns in WHERE clauses.
Software Engineering (Lifecycle and Maintenance)
Prototyping builds a partial system to clarify requirements; throwaway prototypes are discarded, evolutionary ones become the product.
Spiral and incremental models add risk analysis or deliver in increments; they suit large or evolving systems.
Maintenance categories: corrective (fix bugs), adaptive (new environment), perfective (improve features), preventive (reduce future problems).
Configuration management tracks versions of code, documents and builds so any release can be reproduced.
A release candidate is a build believed ready for release; a hotfix is an urgent patch to production.
Technical debt is the future cost of shortcuts; it should be recorded and repaid deliberately.
A post-implementation review compares delivered outcomes with objectives and records lessons learned.
Metrics such as defect density and mean time to repair indicate quality; lines of code alone is a poor productivity measure.
Security (Cryptography and Controls)
Encryption provides confidentiality; hashing provides integrity checks; a MAC combines a key with a hash to authenticate a message.
Key length matters: longer keys increase brute-force cost, but algorithm weakness can defeat length entirely.
A salt defeats precomputed rainbow tables; a pepper is a secret value added to hashes and stored separately.
Certificate pinning ties an application to a specific key or certificate, reducing exposure to rogue authorities.
A digital certificate does not by itself guarantee a trustworthy site; users must still verify the domain and context.
Physical controls (locks, badges), administrative controls (policies, training) and technical controls (firewalls, encryption) form the control set.
Backups must be tested by restore drills; an untested backup is an unverified assumption.
Security awareness training targets phishing and password hygiene, the most common entry points for attackers.
Ethics (Data and Society)
Personal data is information relating to an identified or identifiable person; pseudonymisation reduces but does not remove identifiability.
Data subject rights commonly include access, rectification, erasure and objection; organisations must respond within legal deadlines.
Privacy by design embeds protection into system design rather than adding it afterwards.
Surveillance capitalism describes business models that monetise behavioural data; transparency and consent are central concerns.
Fake news and misinformation spread through recommendation algorithms that maximise engagement; labelling and source verification are countermeasures.
AI accountability requires human oversight, explainability where feasible, and redress for harmful decisions.
Universal design and assistive technology improve access; compliance with accessibility standards is often a legal requirement.
Digital literacy includes evaluating sources, protecting credentials and understanding one's digital footprint.
Computer Systems (Memory and Storage)
RAM is volatile and holds running programs and data; ROM is non-volatile and holds firmware such as the boot loader.
SRAM uses flip-flops and is fast and expensive (cache); DRAM uses capacitors and needs refresh (main memory).
SSDs use flash memory with no moving parts, giving low latency and shock resistance; HDDs use spinning platters and are cheaper per terabyte.
Locality of reference: temporal (reuse soon) and spatial (nearby addresses) explain why caches work.
Cache mapping: direct (one place per block), fully associative (anywhere), set-associative (a set of places); associative reduces conflict misses.
Write-through writes to cache and memory immediately; write-back defers until eviction and needs a dirty bit.
Virtual memory gives each process an isolated address space and allows more logical memory than physical RAM.
Secondary storage is persistent; tertiary storage such as tape is used for archival backup with high capacity and slow access.
Data Representation (Data Types and Accuracy)
An unsigned 8-bit byte holds 0 to 255; a signed 8-bit two's complement byte holds −128 to 127.
Rounding versus truncation: truncation discards extra digits, introducing bias; rounding to nearest reduces error.
Absolute error = |measured − true|; relative error = absolute error / |true value|, often expressed as a percentage.
Floating point precision is limited by mantissa bits; single precision gives about 7 significant decimal digits, double about 15.
Integer overflow wraps in many languages and raises an error in others; checking before arithmetic prevents silent corruption.
Sound and image files store metadata (sample rate, dimensions, colour depth) that determines quality and size.
A file format specifies how bytes map to data; using the wrong format produces unreadable or corrupted output.
Data validation checks range, type and format; verification checks that data was copied or entered correctly, e.g. double entry.
Digital Logic (Registers and Memory)
A register is a group of flip-flops sharing a clock; an n-bit register stores n bits and may support parallel load and shift.
A shift register moves bits left or right on each clock; serial-in/parallel-out converts serial data to parallel form.
A counter increments on each clock edge; ripple counters chain flip-flops and suffer propagation delay, synchronous counters clock together.
A memory cell stores one bit; an address decoder selects the row, and a read/write line determines the operation.
ROM types: mask-programmed (fixed at manufacture), PROM (one-time programmable), EPROM (erasable), EEPROM (electrically erasable).
A bus carries addresses, data and control signals; the address bus width sets the addressable range (2^n locations).
A clock synchronises sequential circuits; setup and hold times must be respected for reliable latching.
An adder-subtractor uses XOR gates to conditionally invert the subtrahend and sets carry-in to 1 for subtraction.
Programming (Paradigms and Concurrency)
Imperative programming specifies steps and state changes; declarative programming specifies what is wanted (SQL, Prolog, functional expressions).
Object-oriented programming bundles state and behaviour in objects and uses encapsulation, inheritance and polymorphism.
A race condition occurs when the result depends on the timing of unsynchronised concurrent accesses to shared data.
A mutex allows one thread into a critical section; a semaphore permits a fixed number of concurrent accesses.
Atomic operations complete without interruption; they underpin locks and lock-free data structures.
A thread pool reuses worker threads to avoid the cost of creating a thread per task.
Functional programming avoids mutable state and treats functions as values; pure functions return the same output for the same input.
Event-driven programming responds to events through callbacks or handlers; the main loop dispatches events in order.
Algorithms (Sorting and Searching Details)
Binary search loop invariant: the target, if present, lies within the current low-to-high range; the range shrinks each iteration.
Binary search on 1,000,000 sorted items takes at most 20 comparisons because 2^20 exceeds 1,000,000.
Stable sorts preserve equal-key order and are needed for multi-key sorting; merge sort and insertion sort are stable, quicksort and heapsort are not.
Heapsort builds a heap in O(n), repeatedly extracts the maximum in O(log n), and sorts in O(n log n) with O(1) extra space.
Shell sort generalises insertion sort with a gap sequence; it is faster than O(n²) in practice but its complexity depends on the gap sequence.
Radix sort processes digits from least to most significant and runs in O(d(n + k)) for d digits and base k.
Interpolation search estimates the position for uniformly distributed sorted data and averages O(log log n) but degrades to O(n).
Searching an unsorted collection requires O(n) time; sorting first costs O(n log n) but enables repeated O(log n) searches.
Networks (Wireless and Emerging)
Wi-Fi channels overlap; 2.4 GHz has three non-overlapping channels (1, 6, 11) in common deployments, while 5 GHz offers more.
Cellular generations: 4G LTE offers high-speed data, 5G adds lower latency and higher density; each generation changes the radio technology.
Bluetooth is a short-range personal-area network; it uses pairing and frequency hopping to reduce interference.
IoT devices often have constrained power and bandwidth; protocols such as MQTT use lightweight publish-subscribe messaging.
Software-defined networking separates the control plane (routing decisions) from the data plane (forwarding).
Network virtualisation and containers let many logical networks share physical infrastructure.
Edge computing processes data near the source to reduce latency and backhaul traffic compared with central cloud processing.
IPv6 removes NAT dependence by providing a vast address space and supports stateless address autoconfiguration.
Databases (Data Management and Big Data)
A data warehouse consolidates historical data for analysis; a data mart is a subset focused on one business area.
OLTP handles many short transactions; OLAP handles complex analytical queries over large historical datasets.
ETL extracts, transforms and loads data into a warehouse; ELT loads first and transforms inside the target system.
The CAP theorem states a distributed system cannot guarantee consistency, availability and partition tolerance simultaneously.
NoSQL families: key-value, document, column-family and graph; each trades relational guarantees for scale or flexibility.
Sharding partitions data across servers by a key; replication copies data for availability and read scaling.
Data quality dimensions include accuracy, completeness, consistency, timeliness and uniqueness.
A data dictionary documents tables, columns, types and constraints, supporting maintenance and governance.
Software Engineering (Architecture and Design)
Layered architecture separates presentation, business logic and data access, so a layer can change without rewriting others.
MVC separates model (data and rules), view (presentation) and controller (input handling).
A microservices architecture splits an application into independently deployable services communicating over the network; it adds operational complexity.
An API contract specifies endpoints, request and response formats, status codes and error behaviour.
SOLID principles: single responsibility, open-closed, Liskov substitution, interface segregation, dependency inversion.
Separation of concerns assigns each module one area of responsibility, improving testability and change isolation.
A message queue decouples producers and consumers and buffers load spikes; it introduces eventual consistency.
Architectural trade-offs include latency versus consistency, coupling versus reuse, and cost versus resilience.
Security (Web and Application Threats)
Buffer overflow writes beyond allocated memory; defences include bounds checking and non-executable stacks.
Cross-site request forgery tricks a logged-in user's browser into sending an unwanted request; tokens and SameSite cookies defend against it.
Insecure direct object references expose data when access checks rely only on user-supplied identifiers; authorise every request server-side.
Security misconfiguration includes default passwords, verbose error messages and unnecessary open ports.
Logging and monitoring detect attacks; logs must avoid storing secrets and must be protected from tampering.
Input validation should be allow-list based (permit known-good patterns) rather than deny-list based.
Secure development includes dependency scanning, since third-party libraries often contain known vulnerabilities.
Penetration testing simulates attacks under authorisation; it complements, but does not replace, code review and automated scanning.
Ethics (Intellectual Property and Access)
Public domain works have no copyright; Creative Commons licences grant reuse under stated conditions such as attribution or non-commercial use.
Copyleft licences require derivative works to keep the same licence; permissive licences allow proprietary reuse with attribution.
Plagiarism presents others' work as one's own; correct citation and paraphrasing with attribution avoid it.
Software patents cover techniques and processes, while copyright covers the expression of code, not the ideas behind it.
Digital rights management restricts copying but can limit legitimate uses such as format shifting or archiving.
Accessibility law may require public sector websites to meet standards; failure can lead to legal challenge.
Digital inclusion addresses affordability, skills and infrastructure, not only device availability.
Professional codes of conduct require competence, confidentiality and avoidance of harm to the public.
Computer Systems (I/O and Performance)
I/O techniques: programmed I/O (CPU polls), interrupt-driven I/O (device signals CPU), and DMA (controller transfers directly to memory).
DMA frees the CPU during bulk transfers but still needs an interrupt to signal completion.
Buffering smooths speed differences between devices; spooling queues jobs such as print tasks for later processing.
Disk access time = seek time + rotational latency + transfer time; SSDs eliminate seek and rotational delay.
Throughput measures completed work per unit time; response time measures delay from request to result.
Benchmarks must reflect representative workloads; a single synthetic benchmark can mislead about real performance.
Power consumption scales with frequency and voltage; reducing both lowers energy use, which matters for mobile and data-centre systems.
Virtualisation lets one physical machine host several isolated virtual machines, improving utilisation but adding overhead.
Data Representation (Sets, Logic and Encoding)
A bitmask uses individual bits as flags; testing a flag uses AND with the mask, setting uses OR, clearing uses AND with the complement.
Truth table equivalence: two expressions are equivalent if their truth tables match for every input combination.
XOR is associative and commutative; x XOR x = 0 and x XOR 0 = x, which enables simple parity and swap tricks.
Tautology is always true, contradiction always false, contingency depends on inputs; a satisfiable expression has at least one true row.
Gray code changes only one bit between successive values, reducing errors in mechanical encoders.
Base conversion: divide repeatedly by the target base and read remainders in reverse to convert decimal to another base.
Error detection: checksum sums data values; CRC uses polynomial division and detects burst errors better than a simple checksum.
Compression ratio = uncompressed size / compressed size; saving percentage = (1 − compressed/uncompressed) × 100.
Programming (Input, Output and Files)
A file handle or stream abstracts a file; open modes include read, write (truncate) and append.
A text file stores characters with encoding and line endings; a binary file stores raw bytes and needs format knowledge.
Reading a file with a loop until end-of-file requires checking the read result, not just the current value.
Always close files or use a construct that closes them automatically, otherwise buffers may not flush and handles leak.
Serialisation converts objects to a storable format (JSON, XML, binary); deserialisation recreates them.
CSV is simple but ambiguous with commas and quotes inside fields; proper quoting and escaping are required.
Input validation must reject malformed data and handle empty input, since users and files can supply anything.
Standard streams are stdin, stdout and stderr; errors should go to stderr so they can be separated from normal output.
Algorithms (Problem-Solving Techniques)
Divide and conquer splits a problem, solves subproblems recursively and combines results; merge sort and binary search are examples.
Backtracking explores candidates and abandons partial solutions that violate constraints, as in N-queens and Sudoku.
Branch and bound adds bounds to prune search space in optimisation problems.
Simulation models a system's behaviour over time step by step; it suits queuing and physical systems.
Randomised algorithms use random choices; Las Vegas algorithms are always correct with random runtime, Monte Carlo may err with bounded probability.
A flowchart uses standard symbols: oval for start/end, parallelogram for input/output, rectangle for process, diamond for decision.
Pseudocode describes logic independently of syntax, enabling review before coding.
Dry running (tracing) a algorithm by hand with a table of variable values reveals logic errors before implementation.
Networks (Protocols and Services Details)
SMTP sends mail, POP3 downloads and typically deletes from the server, IMAP keeps mail synchronised on the server.
FTP uses separate control and data connections; SFTP runs over SSH for encrypted transfer.
DHCP uses a four-step exchange: discover, offer, request, acknowledgement (DORA).
NTP synchronises clocks across a network, which matters for logging, certificates and distributed systems.
A subnet divides a network into broadcast domains; routers connect subnets and VLANs segment them logically on switches.
The default gateway is the router address used for traffic destined outside the local subnet.
ICMP reports network errors and supports diagnostics such as ping and traceroute; it is not a transport protocol.
Packet loss and jitter degrade real-time media; buffering and QoS mitigate them.
Databases (Design and Normal Forms)
Functional dependency X → Y means each X value determines one Y value; keys are determined by all attributes they identify.
1NF requires atomic values and no repeating groups; 2NF requires 1NF and no partial dependency on part of a composite key.
3NF requires 2NF and no transitive dependency of a non-key attribute on a non-key attribute.
BCNF requires every determinant to be a candidate key; it is stricter than 3NF.
Over-normalisation can require many joins; denormalise deliberately when read performance dominates.
A junction table resolves many-to-many relationships and carries its own attributes such as quantity or date.
Referential actions on delete: RESTRICT blocks, CASCADE deletes dependents, SET NULL clears the reference.
A surrogate key is stable and compact; a natural key carries meaning but may change, causing update cascades.
Software Engineering (Quality and Process)
Verification asks whether the product is built right; validation asks whether the right product is built.
A quality assurance process prevents defects; quality control detects them through testing and inspection.
Static analysis tools detect issues such as unused variables, null dereferences and style violations without executing code.
Fuzz testing feeds random or malformed inputs to find crashes and security flaws.
A bug report should include environment, steps to reproduce, expected and actual results, and severity.
Continuous delivery keeps software always releasable; continuous deployment releases every passing change automatically.
A service level agreement specifies measurable targets such as uptime and response time, with consequences for misses.
Root cause analysis asks why repeatedly until the underlying process failure is found, not just the immediate symptom.
Security (Cryptography and Identity)
Symmetric key distribution is the hard problem; key exchange protocols such as Diffie-Hellman establish a shared secret over an insecure channel.
Diffie-Hellman alone provides no authentication, so it is vulnerable to man-in-the-middle unless combined with certificates.
A hash function should be deterministic, fast to compute, one-way and collision-resistant; SHA-256 is a standard choice.
Digital certificates chain to a trusted root; any compromised authority in the chain undermines trust.
Single sign-on authenticates once for multiple services; it improves usability but concentrates risk in the identity provider.
Federated identity lets one organisation's credentials be accepted by another through trust agreements.
Password policies should enforce length and block common passwords rather than rely on forced complexity and frequent rotation.
Biometrics are convenient but cannot be revoked if compromised; they should be combined with another factor.
Ethics (Regulation and Governance)
Data protection principles include lawfulness, fairness, transparency, purpose limitation, minimisation, accuracy, storage limitation, integrity and accountability.
A data protection impact assessment identifies and mitigates risks before processing high-risk personal data.
A data breach may require notification to a regulator and to affected individuals within defined time limits.
Cross-border data transfer rules restrict sending personal data to jurisdictions with weaker protection.
Sector regulation adds requirements, for example health data or financial records, on top of general data protection law.
Computer misuse law criminalises unauthorised access and modification; authorised penetration testing requires written permission.
Consumer protection law addresses misleading claims, unfair terms and unsafe products, including software.
Governance structures assign accountability for data and AI systems, including review boards and audit trails.
Computer Systems (Architecture and Buses)
The system bus carries addresses, data and control signals between CPU, memory and I/O; a wider data bus transfers more bits per cycle.
The address bus width determines the maximum addressable memory: n address lines address 2^n locations.
CISC instructions may take multiple cycles; RISC instructions are typically single-cycle and rely on the compiler to schedule work.
Instruction-level parallelism includes pipelining, superscalar execution and out-of-order execution.
A GPU has many simple cores optimised for parallel throughput, while a CPU has fewer cores optimised for low-latency serial work.
Firmware such as BIOS or UEFI initialises hardware and starts the boot loader; it is stored in non-volatile memory.
The memory management unit translates virtual addresses and enforces access permissions, enabling protected memory.
A system on a chip integrates CPU, memory controller and peripherals on one die, reducing size and power.
Data Representation (Files and Formats)
A file header identifies the format and often stores metadata before the payload; misreading it corrupts interpretation.
Text encoding must match between writer and reader; UTF-8 read as Latin-1 produces mojibake.
Image size in bytes ≈ width × height × colour depth / 8 before compression; colour depth is bits per pixel.
Audio size in bytes = sample rate × bit depth / 8 × channels × duration in seconds.
Video size depends on resolution, frame rate, colour depth and compression; compression dominates practical sizes.
Lossless formats preserve exact data (PNG for images, FLAC for audio); lossy formats trade fidelity for size (JPEG, MP3).
Metadata can reveal more than intended, such as location in photographs; stripping it protects privacy.
Endianness defines byte order: big-endian stores the most significant byte first, little-endian the least.
A checksum or hash verifies file integrity after transfer or storage.
Programming (Testing and Quality)
Unit tests should be fast, isolated and deterministic; they test one behaviour per case with clear arrange-act-assert structure.
A stub returns canned data; a mock verifies interactions; both replace real dependencies in tests.
Test coverage is a guide, not a goal; high coverage with weak assertions can still miss defects.
Regression tests guard against reintroducing fixed bugs and should run automatically on every change.
Property-based testing asserts invariants over generated inputs rather than enumerating examples.
Integration tests check that components work together, including databases and network calls.
Test data should include normal, boundary, invalid and empty cases to exercise error handling.
Continuous testing runs automated suites in the pipeline and blocks merges that fail.
Algorithms (Data Processing and Analysis)
MapReduce processes data in parallel: map emits key-value pairs, shuffle groups by key, reduce aggregates each group.
Sorting before joining (sort-merge join) is efficient for large datasets that do not fit in memory.
A hash join builds a hash table on the smaller input and probes it with the larger, running in expected linear time.
Streaming algorithms process data in one pass with bounded memory, often producing approximate results such as sketches.
Sampling estimates aggregates from a subset; accuracy improves with sample size and unbiased selection.
Deduplication identifies identical or near-identical records; exact matching uses keys or hashes, fuzzy matching uses similarity measures.
Data cleaning handles missing values, outliers and inconsistent formats before analysis.
Visualisation choices matter: bar charts compare categories, line charts show trends over time, scatter plots show relationships.
Networks (Internet Architecture and Governance)
The internet is decentralised: autonomous systems exchange routes using BGP, and no single entity owns it.
Standards bodies include IETF (protocols such as TCP/IP), W3C (web standards) and ICANN (domain names and addresses).
Content delivery networks cache content at edge locations to reduce latency and origin load.
The domain name hierarchy runs from root to top-level domain to second-level domain; registrars manage allocation.
Anycast routes a single address to multiple servers and delivers to the nearest, used by DNS root servers and CDNs.
Peering and transit describe how networks exchange traffic commercially; settlement-free peering requires mutual benefit.
Network neutrality debates concern whether ISPs may prioritise or throttle traffic by source or type.
IPv4 exhaustion drove NAT adoption and IPv6 deployment; dual-stack hosts run both protocols.
Databases (Security and Administration)
Database roles grant privileges by function; least privilege means applications get only the operations they need.
SQL injection is prevented by parameterised queries and by restricting database account privileges.
Encryption at rest protects stored data; encryption in transit protects queries and results on the network.
Audit logs record who accessed or changed data, supporting investigation and compliance.
Backups should be encrypted and stored separately; restore procedures must be rehearsed.
A database administrator manages schema changes, performance tuning, backups and access control.
Views can restrict access to selected columns, hiding sensitive fields from some users.
Row-level security enforces access rules per row, useful for multi-tenant applications.
Software Engineering (Teams and Delivery)
Agile ceremonies include sprint planning, daily stand-up, sprint review and retrospective.
A product backlog is ordered by value; a sprint backlog is the subset committed for one iteration.
Velocity is the average work completed per iteration and supports forecasting, not performance comparison between teams.
Definition of done is a shared checklist ensuring increments meet quality standards before acceptance.
Cross-functional teams include the skills needed to deliver end to end, reducing handoffs.
Distributed teams need explicit communication norms and shared documentation to compensate for lost informal contact.
Stakeholder feedback loops shorten when releases are frequent and users can respond to working software.
Retrospectives identify process improvements; without follow-up actions they become ritual.
Security (Risk and Resilience)
Threat modelling identifies assets, threats, vulnerabilities and mitigations before code is written.
A vulnerability is a weakness; an exploit is the technique that abuses it; a patch removes the weakness.
Business continuity plans keep critical operations running during disruption; disaster recovery restores systems afterwards.
Recovery point objective (RPO) is the acceptable data loss; recovery time objective (RTO) is the acceptable downtime.
Redundancy (duplicate hardware, multiple sites) improves availability but adds cost and complexity.
Failover switches to a standby system; failback returns to the primary after recovery.
Security incident severity depends on data sensitivity, scope and business impact, guiding escalation.
Post-incident reviews document causes and improvements so the same failure is less likely to recur.
Ethics (Professional Practice and Society)
Informed consent for research data requires voluntary participation, clarity about use and the right to withdraw.
Anonymity and confidentiality differ: anonymity hides identity from the researcher, confidentiality protects it from others.
Bias in datasets can produce discriminatory outcomes; auditing data and models is a professional obligation.
Transparency about algorithmic decision-making supports accountability, especially in public services.
Whistleblower protections vary by jurisdiction; documenting concerns internally is usually advisable first.
Professional development keeps skills current as technology changes, supporting competence obligations.
Conflict of interest should be disclosed and managed, for example when evaluating a supplier one has invested in.
Digital legacy and posthumous data raise questions about who controls accounts and data after death.
Computer Systems (Concurrency and Scheduling)
Concurrency interleaves tasks on one core; parallelism executes them simultaneously on multiple cores.
A critical section accesses shared state and must be protected by a lock or other synchronisation primitive.
Deadlock prevention by ordering lock acquisition avoids circular wait; timeouts and detection recover from deadlocks.
Starvation occurs when a thread never gets scheduled; fairness and ageing mitigate it.
Priority inversion happens when a high-priority task waits on a lock held by a low-priority task; priority inheritance addresses it.
Scheduling metrics: CPU utilisation, throughput, turnaround time, waiting time and response time.
Round-robin time slice too large behaves like FCFS; too small increases context-switch overhead.
Multicore scheduling must consider cache affinity to avoid losing warm cache data when moving threads.
Data Representation (Number Systems and Accuracy)
Base b to decimal: sum each digit times b^position; decimal to base b: divide by b repeatedly and read remainders in reverse.
Hexadecimal is compact for binary because each hex digit maps exactly to four bits; octal maps to three.
Fixed-point representation has a fixed number of fractional bits, giving uniform precision but limited range.
Floating point trades precision for range: very large and very small values are representable but not all exactly.
Catastrophic cancellation occurs when subtracting nearly equal floating-point numbers, amplifying relative error.
Rounding modes include round-to-nearest-even, which reduces accumulated bias.
Overflow and underflow in floating point produce infinity or zero; programs should check for these cases.
Exact decimal fractions with denominator factors of 2 and 5 terminate in decimal but not necessarily in binary.
Programming (Data Structures and Algorithms)
Choosing a structure depends on operations: frequent lookup favours hash tables, ordered traversal favours balanced trees.
An array of records stores many fields per item; parallel arrays store one field per array and risk desynchronisation.
A dynamic array's amortised append cost is O(1) because capacity doubles occasionally.
A linked list uses extra memory per node for pointers; arrays have better cache locality.
A stack can check balanced brackets by pushing open symbols and matching on close.
A queue can implement breadth-first search by enqueueing neighbours and marking them visited on enqueue.
A hash function should be deterministic and spread keys; poor hashing turns O(1) lookup into O(n).
A binary search tree becomes a linked list if keys are inserted in sorted order; balancing prevents this.
Algorithms (Optimisation and Limits)
Linear programming optimises a linear objective subject to linear constraints; the feasible region is a polytope.
The travelling salesman problem is NP-hard; heuristics such as nearest neighbour give fast but non-optimal tours.
Bin packing and scheduling are combinatorial optimisation problems solved exactly only for small instances.
Greedy algorithms are fast but may be suboptimal; dynamic programming guarantees optimality when subproblems overlap.
Approximation algorithms guarantee a ratio to the optimum, for example within twice the best possible.
Lower bounds prove no algorithm can do better; comparison sorting requires Ω(n log n) comparisons.
Reductions show hardness: if problem A reduces to B and A is hard, B is at least as hard.
P versus NP asks whether every problem with an efficiently verifiable solution also has an efficient solver.
Networks (Performance and Troubleshooting)
Ping tests reachability and round-trip time; traceroute shows the path and where delays occur.
High latency with low packet loss suggests distance or processing delay; high loss suggests congestion or faulty links.
Bandwidth utilisation near capacity causes queuing delay and jitter; capacity planning keeps headroom.
Duplex mismatch causes collisions and poor throughput on Ethernet links.
DNS failures present as name resolution errors while direct IP connections still work.
A firewall blocking a port produces connection timeouts, not immediate refusals; distinguishing the two narrows the cause.
Wireless interference and weak signal reduce throughput; channel selection and access point placement help.
Cable testing and interface error counters reveal physical layer faults before higher layers are suspected.
Databases (Transactions and Recovery)
A transaction groups operations so they succeed or fail as a unit; partial completion is not allowed.
Write-ahead logging records changes before applying them, enabling undo and redo after a crash.
Two-phase commit coordinates distributed transactions: prepare then commit, with a coordinator tracking participants.
Optimistic concurrency checks a version at commit and retries on conflict; pessimistic locking blocks conflicts upfront.
A phantom read occurs when a repeated query returns new rows inserted by another transaction.
Deadlocks in databases are detected by a wait-for graph and resolved by aborting one transaction.
Checkpoints limit recovery work by marking a consistent point in the log.
Idempotent operations can be retried safely after uncertain failures, simplifying recovery.
Software Engineering (Requirements and Change)
Elicitation techniques include interviews, observation, questionnaires, document analysis and workshops.
A requirement should be unambiguous, testable, feasible and traceable to a source.
MoSCoW prioritises requirements as must, should, could and won't have for this release.
Change control records a requested change, assesses impact, approves or rejects it, and updates documentation.
Traceability links requirements to design, code and tests, helping assess the impact of change.
Prototypes reduce requirements risk by making assumptions visible early.
Non-functional requirements need measurable targets, such as response under two seconds for 95% of requests.
Acceptance criteria define the conditions a feature must satisfy to be accepted by the customer.
Security (Controls and Assurance)
Preventive controls stop incidents; detective controls identify them; corrective controls restore service.
Encryption, access control and firewalls are preventive; logs, IDS and audits are detective; backups and patches are corrective.
Security assurance comes from independent audit, certification and continuous monitoring.
Vulnerability scanning finds known weaknesses; penetration testing exploits them to assess real impact.
Patch management prioritises critical vulnerabilities and tracks deployment across assets.
Asset inventory is a prerequisite for security: unknown devices cannot be protected or patched.
Third-party risk management assesses supplier security through questionnaires, contracts and audits.
Security metrics include time to patch, number of open critical vulnerabilities and incident response time.
Ethics (AI and Emerging Technology)
Explainability is the degree to which a human can understand why a model produced an output; simpler models are often more explainable.
Fairness metrics include demographic parity and equal opportunity; they can conflict, requiring a value judgement.
Human oversight keeps a person accountable for consequential automated decisions.
Training data provenance matters for legality and bias; unlicensed data creates legal risk.
Deepfakes raise harms of fraud and misinformation; provenance signals and detection tools are partial countermeasures.
Autonomous systems raise liability questions when harm occurs without a human in the loop.
Regulation of AI often takes a risk-based approach, with stricter rules for high-risk uses.
Public consultation and impact assessment help align technology with societal values.
Computer Systems (Virtualisation and Cloud)
A hypervisor runs virtual machines; type 1 runs on bare metal, type 2 runs on a host operating system.
Containers share the host kernel and isolate processes, making them lighter than virtual machines.
Virtual machines provide strong isolation; containers start faster but share kernel vulnerabilities.
Cloud elasticity scales resources automatically with demand; scalability is the capacity to scale.
IaaS gives control of the operating system; PaaS manages the runtime; SaaS manages the application.
Serverless computing runs functions on demand and bills per invocation, abstracting servers entirely.
Multi-tenancy shares infrastructure among customers; isolation and noisy-neighbour effects must be managed.
Cloud cost models include compute time, storage, data transfer and managed service fees; egress charges can dominate.
Data Representation (Multimedia and Compression)
Colour depth of n bits per pixel allows 2^n colours; 24-bit true colour uses 8 bits each for red, green and blue.
Resolution is pixel dimensions; higher resolution increases file size quadratically for the same colour depth.
Vector graphics store shapes and scale without pixelation; raster graphics store pixels and lose quality when enlarged.
Sampling rate must exceed twice the highest frequency to avoid aliasing (Nyquist criterion).
Bit depth in audio sets dynamic range and noise floor; 16-bit is common for consumer audio.
JPEG uses DCT and quantisation to discard imperceptible detail; repeated re-saving accumulates loss.
PNG uses lossless deflate compression and supports transparency; GIF is limited to 256 colours.
Video compression exploits temporal redundancy between frames (motion estimation) as well as spatial redundancy within a frame.
Programming (Control Flow and Logic)
A selection statement chooses a branch by condition; a switch or match selects among many constant cases.
A loop guard must eventually become false; an invariant helps prove termination and correctness.
Off-by-one errors occur at boundaries; test loops with zero, one and many iterations.
Short-circuit evaluation means side effects in later operands may not run; avoid relying on them.
Nested loops multiply iteration counts; moving invariant work outside the inner loop reduces cost.
A break exits the nearest loop; continue skips to the next iteration; return exits the function entirely.
Boolean simplification reduces conditions: NOT(A OR B) becomes NOT A AND NOT B, improving readability.
Guard clauses return early on invalid input, flattening nested conditionals.
Algorithms (String and Sequence Processing)
Naive substring search is O(nm) worst case; KMP preprocesses the pattern to achieve O(n + m).
Edit distance (Levenshtein) computes the minimum insertions, deletions and substitutions between strings using dynamic programming.
Regular expressions match patterns; greedy quantifiers take as much as possible, lazy quantifiers as little.
String comparison is lexicographic by character code; case-insensitive comparison normalises case first.
Hashing a string enables O(1) average equality checks but requires collision handling.
Longest common subsequence uses dynamic programming in O(nm) time and space.
Run-length encoding is a simple compression for strings with repeated characters.
Tries support prefix queries efficiently, useful for autocomplete and dictionary lookup.
Networks (Protocols and Layering)
Encapsulation adds headers at each layer: application data becomes a segment, packet, frame, then bits.
Decapsulation reverses the process at the receiver, stripping headers layer by layer.
Each layer provides services to the layer above and uses the layer below; changes in one layer can be hidden from others.
The transport layer provides end-to-end delivery; the network layer provides host-to-host routing.
The data link layer handles framing, error detection and MAC addressing on a local link.
The physical layer defines voltages, connectors, cabling and signalling rates.
A protocol data unit names the data at each layer: segment (transport), packet (network), frame (link), bits (physical).
Layering aids interoperability but adds header overhead and can hide cross-layer performance issues.
Databases (Data Models and Query Design)
The relational model uses set theory: rows are unordered, and queries return sets unless ordering is specified.
Relational algebra operators include selection, projection, join, union and difference.
SQL NULL introduces three-valued logic: TRUE, FALSE and UNKNOWN; WHERE keeps only TRUE rows.
EXISTS and NOT EXISTS handle correlated subqueries and avoid NULL comparison pitfalls.
A correlated subquery references the outer query and may run per row; a join is often more efficient.
Window functions compute aggregates over a partition without collapsing rows, useful for ranking and running totals.
A common table expression names a subquery for readability and reuse within a statement.
Query plans show join order and access methods; reading them guides index and rewrite decisions.
Software Engineering (Design and Documentation)
An interface defines operations and contracts without implementation; coding to an interface reduces coupling.
Encapsulation hides internal state behind methods, preserving invariants.
Inheritance models an is-a relationship; composition models has-a and is often more flexible.
Polymorphism lets one interface serve multiple implementations, selected at runtime.
A design pattern should be applied when its problem recurs, not preemptively.
Documentation should state purpose, preconditions, postconditions and side effects for each public operation.
Diagrams should be kept consistent with code; outdated documentation misleads maintainers.
Code conventions improve readability and reduce review friction; automated formatters enforce them.
Security (Privacy and Data Protection)
Data minimisation collects only what is necessary; retention limits delete data when no longer needed.
Pseudonymisation replaces identifiers with tokens, reducing risk while allowing linkage with a key.
Anonymisation must resist re-identification; combining datasets can defeat naive removal of names.
Consent must be freely given, specific, informed and revocable; bundled consent is generally invalid.
Privacy impact assessments identify risks to individuals before processing begins.
Access controls and audit trails limit and record who views personal data.
Data breach notification timelines vary by jurisdiction; preparation speeds compliance.
Privacy notices should be clear and concise; obscure legal language undermines informed consent.
Computer Systems (Instruction Execution and Interrupts)
The instruction cycle stages are fetch, decode, execute and write-back; interrupts are checked between instructions.
An interrupt handler runs in privileged mode; the interrupted context is saved and restored.
A trap or exception is a synchronous interrupt caused by the current instruction, such as a page fault.
Privileged instructions can only run in kernel mode; a system call switches from user to kernel mode.
Direct memory access transfers data without per-byte CPU involvement, raising an interrupt at completion.
Pipelining hazards include data dependencies resolved by forwarding or stalling.
Speculative execution improves performance but can leak data through side channels if not carefully managed.
The program counter holds the next instruction address; a branch updates it conditionally or unconditionally.
Data Representation (Bits and Operations)
Bitwise NOT inverts every bit; in two's complement, NOT x equals −x − 1.
Masking with AND extracts selected bits; setting with OR turns bits on; toggling with XOR flips them.
A shift left by one doubles an unsigned value; overflow discards the high bit.
Bit fields pack several small values into one word, saving space but complicating access.
Population count counts set bits; it is used in parity and hashing.
Endianness affects how multi-byte values are stored and transmitted; protocols specify byte order.
Bitwise operations are faster than arithmetic division or modulo by powers of two.
Two's complement addition is the same circuit as unsigned addition; only the interpretation of overflow differs.
Programming (Abstraction and Reuse)
A library is a collection of reusable code called by the program; a framework calls the program's code (inversion of control).
An abstract data type defines behaviour (operations) and hides representation, such as a stack or set.
Generics allow code to work with many types while preserving type safety.
Higher-order functions take or return functions, enabling composition and reuse.
Dependency injection supplies dependencies from outside, improving testability and configurability.
Inheritance can create fragile hierarchies; favour composition when behaviour varies independently.
Versioning libraries requires semantic versioning discipline: major for breaking changes, minor for features, patch for fixes.
Documentation of a module's public interface is essential for safe reuse by others.
Algorithms (Search and Optimisation in Practice)
Binary search can find the first or last occurrence of a value by adjusting the boundary update on equality.
Searching a rotated sorted array still allows O(log n) with a modified binary search.
Ternary search finds the extremum of a unimodal function in O(log n) evaluations.
Hill climbing improves a solution iteratively but can stall at local optima; random restarts help.
Simulated annealing accepts worse moves with decreasing probability to escape local optima.
Genetic algorithms evolve a population using selection, crossover and mutation; they suit large search spaces.
A* is optimal with an admissible heuristic; a consistent heuristic avoids re-expanding nodes.
Memoisation can turn exponential recursion into polynomial time when subproblems repeat.
Networks (Network Security Architecture)
A DMZ hosts public-facing services between two firewalls, limiting exposure of the internal network.
A demilitarised zone separates internet-facing servers from internal systems.
Network segmentation limits lateral movement after a breach.
An intrusion detection system monitors and alerts; an intrusion prevention system can block traffic.
A VPN extends a private network over a public one using encrypted tunnels.
Zero trust assumes no implicit trust based on location and verifies every request.
A bastion host is a hardened gateway for administrative access to internal systems.
Egress filtering restricts outbound traffic, hindering data exfiltration and malware callbacks.
Databases (Data Warehousing and Analytics)
Star schema has a central fact table linked to dimension tables; snowflake schema normalises dimensions further.
A fact table stores measures and foreign keys; dimension tables store descriptive attributes.
OLAP operations include roll-up (aggregate), drill-down (detail), slice and dice (filter and rotate).
Columnar storage improves analytical query performance by reading only needed columns and compressing well.
Partitioning by date or region prunes scanned data for time- or region-filtered queries.
Slowly changing dimensions track attribute history, either overwriting or versioning rows.
Data lineage records where data came from and how it was transformed, supporting trust and debugging.
Dashboards should show the metric, time period and comparison needed for decisions, not every available number.
Software Engineering (Estimation and Risk)
Estimation improves with historical data and decomposition into smaller tasks.
Optimism bias leads to underestimation; reference class forecasting uses similar past projects.
A risk register records risks, likelihood, impact, owner and mitigation.
A spike is a time-boxed investigation to reduce uncertainty before estimating.
Buffer should cover known risks explicitly rather than being hidden in every estimate.
Critical path is the longest dependent sequence; delays there delay the whole project.
Scope creep is uncontrolled expansion of requirements; change control limits it.
A proof of concept tests technical feasibility, not user value; distinguish it from a prototype.
Security (Incident Handling and Forensics)
Preserve evidence by capturing memory and disk images before remediation alters state.
Chain of custody documents who handled evidence and when, supporting legal admissibility.
Containment isolates affected systems to stop spread while preserving evidence.
Eradication removes malware and closes the vulnerability; recovery restores normal operation.
Indicators of compromise include unusual logins, unexpected outbound traffic and modified files.
Log correlation across systems reveals attack patterns that single logs miss.
Forensic analysis should work on copies, never the original evidence.
Lessons learned after an incident update controls, detection rules and response playbooks.
Ethics (Work, Society and Environment)
Automation changes job content; task-level analysis is more accurate than counting whole occupations.
Reskilling programmes should target transferable skills and be accessible to affected workers.
The digital divide includes device access, connectivity, skills and affordability.
E-waste contains hazardous materials and valuable metals; formal recycling recovers value safely.
Energy efficiency in computing includes efficient algorithms, right-sized hardware and renewable-powered data centres.
Accessibility benefits everyone, including users with temporary or situational limitations.
Algorithmic decisions in employment, credit and justice require appeal routes and human review.
Professional ethics includes honesty about limitations and refusing to misrepresent system capabilities.
Computer Systems (Storage Hierarchy and Performance)
Latency hierarchy: registers (sub-nanosecond), cache (nanoseconds), RAM (tens of nanoseconds), SSD (microseconds), disk (milliseconds).
Cache lines are typically 64 bytes; spatial locality means nearby bytes are fetched together.
A cache miss costs the difference between cache and memory latency, so miss rate matters more than hit rate alone.
Virtual memory page size affects TLB reach; larger pages reduce TLB misses but can waste memory.
Write-back caches need a dirty bit to know which lines must be flushed.
Prefetching hides latency by loading data before it is requested, at the risk of wasted bandwidth.
Memory bandwidth limits data-intensive workloads; compute can outpace memory, causing a memory wall.
Storage tiers place hot data on fast media and cold data on cheap media to balance cost and performance.
Data Representation (Sets and Relations)
A set contains unique elements; union combines, intersection finds common elements, difference removes elements of one set from another.
A subset has all elements contained in another set; the empty set is a subset of every set.
A power set has 2^n subsets for a set of n elements.
A relation is a set of ordered pairs; a function is a relation where each input maps to exactly one output.
A Cartesian product of sets A and B is the set of all ordered pairs (a, b).
A database table is a relation over its column domains, and rows are tuples.
A partial order is reflexive, antisymmetric and transitive; a total order also compares every pair.
An equivalence relation is reflexive, symmetric and transitive and partitions a set into classes.
Programming (Recursion and Iteration)
Every recursive algorithm needs a base case and progress toward it, or it will not terminate.
Tail recursion can be optimised into a loop by some compilers, avoiding stack growth.
Recursion mirrors the structure of trees and divide-and-conquer problems, improving clarity.
Iteration avoids call overhead and stack limits but may need explicit stacks for backtracking.
A recursive function's depth equals the longest chain of pending calls; deep recursion risks stack overflow.
Memoising a recursive function caches results and converts exponential work into polynomial work.
Mutual recursion involves two or more functions calling each other; a shared base case is needed.
Converting recursion to iteration uses an explicit stack to hold pending work.
Algorithms (Graph Algorithms in Practice)
Union-find with path compression and union by rank supports near-constant-time connectivity queries.
Cycle detection in undirected graphs uses union-find or DFS; in directed graphs, DFS with a recursion stack detects back edges.
Bipartite graphs can be two-coloured with BFS; an odd cycle makes a graph non-bipartite.
Strongly connected components can be found with Tarjan's or Kosaraju's algorithm in linear time.
Maximum flow problems use Ford-Fulkerson or Edmonds-Karp; they model capacities in networks.
PageRank ranks nodes by link structure, weighting links from important nodes more.
Shortest paths with negative edges but no negative cycles use Bellman-Ford in O(VE).
Graph density affects representation choice: dense graphs favour matrices, sparse graphs favour lists.
Networks (Web and Application Protocols)
HTTP/1.1 keeps connections alive but suffers head-of-line blocking; HTTP/2 multiplexes streams over one connection.
HTTP/3 runs over QUIC (UDP) to reduce handshake latency and avoid TCP head-of-line blocking.
WebSockets provide full-duplex persistent connections for real-time applications.
A REST API uses stateless requests; session state is carried by tokens or cookies.
JSON and XML are common data interchange formats; JSON is lighter, XML supports schemas and namespaces.
Caching headers (Cache-Control, ETag) reduce repeated transfers; conditional requests return 304 when unchanged.
An API gateway centralises authentication, rate limiting and routing for many services.
Rate limiting protects services from abuse and ensures fair use among clients.
Databases (Indexes and Performance)
A B-tree index supports equality and range queries in O(log n); a hash index supports equality only.
A covering index includes all columns a query needs, avoiding table lookups.
Composite index column order matters: the leftmost prefix rule limits which queries can use it.
Indexes slow inserts and updates because each index must be maintained.
A full table scan may be faster than an index when a query returns a large fraction of rows.
Query planners use statistics to choose access paths; stale statistics cause poor plans.
Avoid wrapping indexed columns in functions in WHERE clauses, which prevents index use.
EXPLAIN or an execution plan shows whether indexes are used and where time is spent.
Software Engineering (Testing Strategies)
Equivalence partitioning divides inputs into classes expected to behave the same, reducing redundant tests.
Boundary value analysis targets edges where defects cluster, such as zero, maximum and just beyond.
Decision table testing covers combinations of conditions and actions systematically.
Pairwise testing covers interactions of two factors with far fewer cases than exhaustive testing.
Exploratory testing is simultaneous learning, design and execution, useful where requirements are unclear.
Smoke testing checks basic functionality before deeper testing; it is a quick sanity gate.
Performance testing includes load, stress, soak and spike tests, each targeting a different failure mode.
Usability testing observes real users completing tasks and reveals design problems tests cannot.
Security (Cryptographic Protocols)
TLS provides confidentiality, integrity and authentication; it does not by itself hide metadata such as IP addresses.
Forward secrecy ensures past sessions stay safe if a long-term key is later compromised, using ephemeral key exchange.
A nonce is a number used once to prevent replay attacks.
A message authentication code verifies integrity and authenticity using a shared key.
Key management includes generation, distribution, storage, rotation and destruction.
Hard-coded keys in source code are a common vulnerability; secrets should be stored in secure vaults.
Certificate expiry causes outages; monitoring expiry dates prevents avoidable failures.
Quantum computing threatens current public-key algorithms; post-quantum algorithms are being standardised.
Ethics (Law and Digital Citizenship)
Copyright protects original expression fixed in a medium; facts and ideas are not protected.
Fair use or fair dealing permits limited use for purposes such as criticism, teaching or news, judged case by case.
Software licences define permitted use, modification and redistribution; violating them is a breach of contract or copyright.
Cyberbullying and harassment laws impose duties on platforms and schools to respond to reports.
Digital citizenship includes respecting privacy, avoiding plagiarism and reporting harmful content.
Freedom of expression is limited by laws on defamation, incitement and hate speech, varying by jurisdiction.
Terms of service are contracts; accepting them creates obligations even when unread.
Consumer rights include remedies for faulty digital products and clear information before purchase.
Computer Systems (Architecture Styles)
Harvard architecture separates instruction and data memories, allowing simultaneous fetch; von Neumann shares one memory and bus.
CISC aims to reduce instruction count; RISC aims to simplify each instruction for pipelining.
Superscalar processors issue multiple instructions per cycle; out-of-order execution reorders for efficiency while preserving results.
SIMD processes multiple data elements with one instruction, useful for graphics and scientific computing.
A coprocessor or accelerator offloads specialised work such as floating-point maths or encryption.
Memory-mapped registers let software control devices with ordinary load/store instructions.
An instruction pipeline typically has stages such as fetch, decode, execute, memory and write-back.
Embedded processors often omit caches and virtual memory to reduce cost, power and unpredictability.