NSCT Comprehensive Exam Cheat Sheet & Formulas
Official 10-Domain Quick Revision • NSCTPrep.com & NSCTTest.com
Data Structures & Algorithms (10% Weightage)
Core formulas & tested exam invariants
Big-O Runtime Complexity Master Table
| Algorithm / Structure | Best | Average | Worst Case | Space Complexity |
|---|---|---|---|---|
| Array Access | O(1) | O(1) | O(1) | O(n) |
| Binary Search | O(1) | O(log n) | O(log n) | O(1) |
| Merge Sort | O(n log n) | O(n log n) | O(n log n) | O(n) - Stable |
| Quick Sort | O(n log n) | O(n log n) | O(n²) [Sorted array/bad pivot] | O(log n) |
| Heap Sort | O(n log n) | O(n log n) | O(n log n) | O(1) - In-place |
| Hash Table | O(1) | O(1) | O(n) [Hash collision] | O(n) |
| BST Search | O(1) | O(log n) | O(n) [Skewed Tree] | O(n) |
| AVL / Red-Black | O(1) | O(log n) | O(log n) [Guaranteed] | O(n) |
Must-Know Traversal Invariants
•Binary Search Tree In-order Traversal (Left, Root, Right) always outputs keys in strictly ASCENDING order.
•Pre-order Traversal (Root, Left, Right): Used to clone/serialize trees.
•Post-order Traversal (Left, Right, Root): Used for bottom-up node deletion / directory size calculation.
•Complete Binary Tree of height h has between 2ʰ and 2ʰ⁺¹ - 1 nodes.
•For node at index i (1-based): Left child = 2i, Right child = 2i + 1, Parent = ⌊i/2⌋.
Databases & SQL Engineering (10% Weightage)
Core formulas & tested exam invariants
Database Normalization Rules (1NF through BCNF)
•1NF (First Normal Form): Atomic column values only (no repeating groups or arrays). Each row has a primary key.
•2NF (Second Normal Form): Satisfies 1NF + NO partial dependencies (non-key attributes must depend on the WHOLE candidate key, not part of a composite key).
•3NF (Third Normal Form): Satisfies 2NF + NO transitive dependencies (non-key attribute cannot depend on another non-key attribute: A → B → C).
•BCNF (Boyce-Codd Normal Form): Every determinant in a functional dependency (X → Y) must be a Candidate Key or Super Key.
SQL Query Execution Order & Traps
•SQL Clause Logical Execution Order: 1. FROM/JOIN → 2. WHERE → 3. GROUP BY → 4. HAVING → 5. SELECT → 6. DISTINCT → 7. ORDER BY → 8. LIMIT.
•WHERE vs HAVING: WHERE filters rows BEFORE aggregation; HAVING filters aggregated groups (e.g. HAVING COUNT(*) > 2).
•NULL Pitfall: NULL = NULL evaluates to UNKNOWN/FALSE. Use IS NULL or IS NOT NULL.
•COUNT(*) counts all rows including NULLs; COUNT(column_name) ignores NULL rows.
•ACID Properties: Atomicity (All or None), Consistency (Valid state rules), Isolation (Transactions run independently), Durability (Committed data survives crashes).
Computer Networks & Cloud (10% Weightage)
Core formulas & tested exam invariants
IPv4 Subnetting Cheat Sheet (CIDR /24 to /30)
| CIDR Prefix | Subnet Mask | Total IPs | Usable Hosts (2ⁿ - 2) | Block Size |
|---|---|---|---|---|
| /24 | 255.255.255.0 | 256 | 254 hosts | 256 |
| /25 | 255.255.255.128 | 128 | 126 hosts | 128 |
| /26 | 255.255.255.192 | 64 | 62 hosts | 64 |
| /27 | 255.255.255.224 | 32 | 30 hosts | 32 |
| /28 | 255.255.255.240 | 16 | 14 hosts | 16 |
| /29 | 255.255.255.248 | 8 | 6 hosts | 8 |
| /30 | 255.255.255.252 | 4 | 2 hosts (Point-to-Point) | 4 |
OSI 7 Layers & Key Protocols
•Layer 7 (Application): HTTP, HTTPS (443), DNS (53 UDP/TCP), SMTP (25/587), FTP (20/21), SSH (22).
•Layer 4 (Transport): TCP (Connection-oriented, 3-way handshake SYN/SYN-ACK/ACK), UDP (Connectionless, best-effort).
•Layer 3 (Network): IPv4, IPv6, ICMP (Ping), OSPF, BGP. Packets & Routing.
•Layer 2 (Data Link): Ethernet, MAC addresses, Switches, ARP (Resolves IP to MAC). Frames.
•Layer 1 (Physical): Cables, Hubs, Bits (0 and 1).
Object-Oriented Programming & Principles (10% Weightage)
Core formulas & tested exam invariants
Core OOP Pillars & Design Principles
•Encapsulation: Bundling data and methods that manipulate that data while restricting direct access (private variables + public getters/setters).
•Inheritance: Mechanism where a child class acquires attributes & methods from parent. Promotes code reusability (IS-A relationship).
•Polymorphism: Compile-Time (Function / Operator Overloading) vs Run-Time (Method Overriding via virtual functions & dynamic dispatch).
•Abstraction: Hiding internal complex implementation details and exposing only the essential interface (Abstract classes & Interfaces).
•SOLID Principles: Single Responsibility, Open/Closed (Open for extension, closed for modification), Liskov Substitution, Interface Segregation, Dependency Inversion.
Operating Systems & Concurrency (5% Weightage)
Core formulas & tested exam invariants
Process Synchronization & Memory Management
•4 Conditions for Deadlock (Coffman): Mutual Exclusion, Hold and Wait, No Preemption, Circular Wait.
•Banker's Algorithm: Resource allocation algorithm used to avoid deadlock by testing for safe states before allocation.
•Page Fault: Occurs when a program attempts to access memory page not currently loaded in physical RAM.
•Thrashing: When a system spends more time servicing page faults and swapping than executing actual instructions (working set > physical memory).
•Process vs Thread: A process has its own address space, memory, and file handles; threads inside the same process share code, data, and heap, but have independent stacks and program counters.