BSEH SS Computer Science study materials
BSEH SS Computer Science study resources

BSEH SS Computer Science cheat sheet

BSEH SS Computer Science · Keep the key ideas within reach.

Quick reference

Computer Fundamentals and Hardware

  • Von Neumann architecture: CPU (ALU + control unit + registers), memory, I/O; instructions and data share the same memory and bus.

  • CPU cycle: fetch → decode → execute → store; clock speed in Hz sets cycle rate; CPI = average clock cycles per instruction.

  • Primary memory is volatile RAM (SRAM cache, DRAM main memory) and non-volatile ROM/Flash; secondary storage (HDD/SSD) is non-volatile and slower.

  • Memory units: 1 byte = 8 bits; 1 KB = 1024 B; 1 MB = 1024 KB; 1 GB = 1024 MB; 1 TB = 1024 GB.

  • Cache hierarchy L1 < L2 < L3 in size, L1 fastest; locality of reference (temporal and spatial) makes caching effective.

  • Input devices: keyboard, mouse, scanner, microphone, sensor; output devices: monitor, printer, speaker; touchscreen and modem are both input and output.

  • Ports and buses: USB, HDMI, SATA, PCIe; USB is hot-swappable serial bus; HDMI carries digital audio and video.

  • Hardware vs software: firmware (BIOS/UEFI) is stored in ROM and starts the boot process (POST → bootloader → OS).

Quick reference

Number Systems and Data Representation

  • Bases: binary (2), octal (8), hexadecimal (16), decimal (10); group 3 bits per octal digit and 4 bits per hex digit.

  • Decimal to base r: divide repeatedly by r, read remainders bottom-up; base r to decimal: sum digit × r^position.

  • n-bit unsigned range 0 to 2^n − 1; n-bit two's complement range −2^(n−1) to 2^(n−1) − 1.

  • Two's complement of x: invert all bits then add 1; subtraction a − b is performed as a + (−b).

  • Signed-magnitude uses a sign bit; +0 and −0 both exist, unlike two's complement which has a single zero.

  • Character codes: ASCII is 7-bit (128 codes); extended ASCII is 8-bit; Unicode assigns code points; UTF-8 is variable-length (1–4 bytes).

  • Binary arithmetic: 1+1 = 10 (carry 1); overflow in signed addition occurs when two same-sign operands give an opposite-sign result.

  • Bitwise operators: AND, OR, XOR, NOT, left shift (×2) and right shift (÷2) for unsigned values.

Quick reference

Operating Systems and File Management

  • OS functions: process management, memory management, file system management, device management, security and user interface.

  • Process states: new → ready → running → waiting/blocked → terminated; the scheduler moves processes between ready and running.

  • Multiprogramming keeps several jobs in memory; multitasking time-slices the CPU; multiprocessing uses two or more CPUs.

  • Memory management: paging divides memory into fixed-size frames/pages; virtual memory uses disk as an extension of RAM (demand paging, page fault).

  • File path: absolute path starts from the root (/ or C:); relative path is resolved from the current directory; . is current, .. is parent.

  • File attributes: name, extension, size, type, location, created/modified date, read-only/hidden/system flags, permissions.

  • Common CLI commands: ls/dir (list), cd (change directory), mkdir, rm/del, cp/copy, mv/move, pwd; wildcards * and ? match file names.

  • Deadlock needs four conditions: mutual exclusion, hold and wait, no preemption, circular wait; breaking any one prevents it.

Quick reference

Problem Solving and Programming Fundamentals

  • Algorithm properties: finite, definite, has input/output, and is effective; a program is an algorithm expressed in a programming language.

  • Three control structures: sequence, selection (if/if-else/switch), iteration (while, for, do-while).

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

  • Pseudocode is language-independent; it uses keywords such as SET, INPUT, OUTPUT, IF…THEN…ELSE, WHILE…ENDWHILE.

  • Loop types: count-controlled (known iterations) vs condition-controlled (test before = while, test after = do-while, which runs at least once).

  • Variable vs constant: a variable's value may change during execution; a constant is fixed at declaration.

  • Modular design: functions/procedures take parameters, return values, and reduce duplication; top-down design breaks a problem into subproblems.

  • Testing types: dry run (manual trace), desk checking, black-box (I/O only) and white-box (code path) testing; debugging locates and fixes errors.

Quick reference

Python Programming

  • Data types: int, float, complex, bool, str, list, tuple, set, dict; type() returns the type; input() always returns str, so convert with int()/float().

  • Operators: // floor division, % modulus, ** exponent; / always yields float; and/or/not are logical; == compares values, is compares identity.

  • Strings are immutable; indexing s[i], slicing s[a:b:step], and methods upper(), lower(), strip(), split(), join(), replace(), find().

  • Lists are mutable: append(), extend(), insert(i,x), remove(x), pop(), sort(), reverse(); len(), sum(), max(), min() are built-ins.

  • Control flow: if/elif/else, for over range(start, stop, step) or iterables, while with break/continue/else; indentation defines blocks.

  • Functions: def name(params): with optional default arguments and return; local vs global scope; lambda creates anonymous one-expression functions.

  • Exceptions: try/except/finally, raise; common errors are ValueError, TypeError, IndexError, KeyError, ZeroDivisionError.

  • File handling: open(path, mode) with modes r, w, a, r+, b; best practice uses with open(...) as f: so the file closes automatically.

Quick reference

Data Structures: Lists, Stacks and Queues

  • Linear structures store elements in sequence; arrays/lists allow O(1) index access but O(n) insert/delete in the middle.

  • Stack is LIFO: push (add to top), pop (remove from top), peek/top (view top); underflow on pop from empty, overflow on push to full.

  • Queue is FIFO: enqueue at rear, dequeue from front; circular queue reuses slots with (rear + 1) % size.

  • Python list as stack: append() pushes, pop() pops from the end - both O(1) amortized.

  • Python deque (collections.deque) gives O(1) appendleft/popleft for queues; list.pop(0) is O(n).

  • Applications: stack for function calls, undo, expression evaluation and bracket matching; queue for print spooling, CPU scheduling and BFS.

  • Linked list nodes hold data + a pointer; singly linked traversal is O(n); insertion at the head is O(1).

  • Searching: linear search O(n) works on unsorted data; binary search O(log n) requires sorted data.

Quick reference

Database Concepts and SQL

  • DBMS vs file system: a DBMS controls redundancy, enforces integrity, supports concurrent access and backup/recovery.

  • Relational model: table = relation, row = tuple/record, column = attribute; primary key uniquely identifies a row; foreign key references another table's primary key.

  • Keys: candidate key (minimal unique), primary key (chosen candidate, NOT NULL), alternate key (remaining candidates), composite key (two or more columns).

  • SQL categories: DDL (CREATE, ALTER, DROP), DML (INSERT, UPDATE, DELETE), DQL (SELECT), DCL (GRANT, REVOKE), TCL (COMMIT, ROLLBACK).

  • SELECT syntax order: SELECT columns FROM table WHERE condition GROUP BY … HAVING … ORDER BY …; WHERE filters rows, HAVING filters groups.

  • Aggregate functions: COUNT, SUM, AVG, MIN, MAX; DISTINCT removes duplicates; NULL is not equal to anything (use IS NULL).

  • Joins: INNER (matching rows), LEFT/RIGHT OUTER (all rows from one side), FULL OUTER, CROSS (Cartesian product); UNION combines results and removes duplicates.

  • Normalization: 1NF atomic values, 2NF no partial dependency on part of a composite key, 3NF no transitive dependency; BCNF stricter than 3NF.

Quick reference

Computer Networks and Internet

  • Network types by scale: PAN, LAN, MAN, WAN; topology types: bus, star, ring, mesh, tree; star is common and a hub/switch failure affects only that node.

  • OSI layers (7): Physical, Data Link, Network, Transport, Session, Presentation, Application; TCP/IP model: Network Access, Internet, Transport, Application.

  • Protocols: IP (addressing/routing), TCP (reliable, connection-oriented, 3-way handshake), UDP (unreliable, low latency), HTTP/HTTPS, FTP, SMTP/POP3/IMAP, DNS.

  • IP address: IPv4 is 32-bit dotted decimal; IPv6 is 128-bit hexadecimal; private ranges 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16.

  • Devices: hub (broadcasts to all ports), switch (MAC-based forwarding), router (IP-based routing between networks), modem, gateway, repeater.

  • DNS resolves domain names to IP addresses; DHCP assigns IP addresses automatically; NAT maps private to public addresses.

  • Bandwidth vs latency: bandwidth is data per second (bps), latency is delay; transmission time = data size ÷ bandwidth.

  • URL parts: protocol://host:port/path?query#fragment; HTTP status codes: 200 OK, 301 Moved, 403 Forbidden, 404 Not Found, 500 Server Error.

Quick reference

Web Technologies and HTML

  • HTML document skeleton: , , (metadata, ), <body> (visible content).</p>

  • Block elements:

    ,

    ,

    –,
  • Lists:

      unordered (bullets),
        ordered (numbers), definition list with /; uses ,
        , .

  • Forms:

    , ,
  • CSS can be inline (style attribute), internal (

  • Box model: content → padding → border → margin; box-sizing: border-box includes padding and border in width.

  • JavaScript adds behaviour: script in

Quick reference

Cyber Safety, Ethics and Emerging Technologies

  • Malware types: virus (needs a host file), worm (self-replicating over network), trojan (disguised), ransomware (encrypts data for ransom), spyware/keylogger, adware.

  • Phishing, smishing (SMS), vishing (voice), pharming and spoofing trick users into revealing credentials; check URL and sender before entering data.

  • Strong password rules: length ≥ 12, mixed case, digits, symbols, unique per site; MFA (something you know/have/are) adds a second factor.

  • Encryption: symmetric (one shared key, e.g. AES) vs asymmetric (public/private key pair, e.g. RSA); hashing (SHA-256) is one-way and verifies integrity.

  • Firewall filters traffic by rules; antivirus uses signatures/heuristics; VPN encrypts traffic over an untrusted network; backup is the main defence against ransomware.

  • Cyber ethics: no unauthorized access, respect copyright and software licences, no plagiarism, protect personal data, report vulnerabilities responsibly.

  • IT Act-type legal concepts: unauthorized access, data theft, identity theft and cyberstalking are offences; digital footprints persist and are hard to erase.

  • Emerging tech: AI/ML, cloud computing (IaaS/PaaS/SaaS), IoT, blockchain (distributed ledger), big data, 5G, quantum computing, AR/VR, edge computing.

Quick reference

Practical Work and Project

  • Project report structure: title, aim/objective, problem statement, requirements (hardware/software), design, code, testing table, output screenshots, conclusion, bibliography.

  • A project must state scope and limitations; test cases list input, expected output, actual output and result (pass/fail).

  • Python project files: keep .py modules in one folder, use requirements.txt for libraries, and document how to run the program.

  • SQL practicals: CREATE TABLE with data types (INT, VARCHAR(n), DATE, DECIMAL), INSERT sample rows, then SELECT queries with WHERE, ORDER BY, GROUP BY.

  • HTML practicals: valid nesting, closing tags, alt text on images, and a linked external CSS file for consistent styling.

  • Viva questions often ask why a data structure or algorithm was chosen (e.g., stack for undo, queue for scheduling) and its time complexity.

  • Documentation: meaningful variable names, comments for non-obvious logic, docstrings for functions, and version control (git) for changes.

  • Evaluation criteria commonly include correctness, output quality, code readability, originality and the ability to explain one's own code.