Everything the Zoho Round 2 MCQs keep coming back to, in six subjects. Read one subject, then do a 10-question set on it. The orange boxes are the traps that wrong options are built from.
Operating Systemsthe manager between programs and hardware
Basic words
Term
Meaning
Program
Code saved on disk, not running
Process
A program while it runs. Has its own memory. Described by a PCB (Process Control Block: ID, state, registers, priority)
Thread
Smallest unit of CPU work, inside a process. Threads of one process share its memory
Kernel
Core of the OS; runs with full control of the hardware
System call
How a program asks the kernel for a service (e.g. fork(), read())
Context switch
Saving one process's state and loading another's. Pure overhead
Memory split into fixed-size pages (logical) and frames (physical). Causes internal fragmentation, no external
Segmentation
Variable-size pieces by meaning (code, stack). Causes external fragmentation
Virtual memory
Uses disk as extra RAM, so programs bigger than RAM can run
Page fault
The page needed is not in RAM; OS loads it from disk
Thrashing
So many page faults the CPU does almost no real work
TLB
Fast cache for page-table lookups
Page replacement:FIFO (oldest out; suffers Belady's anomaly: more frames can give more faults), LRU (least recently used out), Optimal (replace the page used furthest in future; best but impossible in practice, used as a benchmark).
Allocation: First fit (first hole big enough), Best fit (smallest hole that fits), Worst fit (largest hole).
Disk scheduling
FCFS, SSTF (nearest track first), SCAN (elevator, goes end to end), C-SCAN (one direction, jumps back), LOOK / C-LOOK (like SCAN but turns at the last request).
Traps
Threads share memory; processes don't.
Minimum average waiting time = SJF, not Round Robin.
fork() called n times creates 2ⁿ processes in total (2ⁿ − 1 children).
Computer Networksalso your DevOps interview round
OSI model (7 layers), bottom to top
"Please Do Not Throw Sausage Pizza Away"
#
Layer
Job
Unit
Device / protocol
1
Physical
Bits on wire / radio
Bit
Hub, repeater, cable
2
Data Link
Delivery on the same network, error detection
Frame
Switch, bridge, MAC address, Ethernet
3
Network
Routing between networks
Packet
Router, IP, ICMP (ping)
4
Transport
End-to-end delivery, ports
Segment
TCP, UDP
5
Session
Open / manage / close sessions
Data
RPC
6
Presentation
Encryption, compression, format
Data
SSL/TLS, JPEG
7
Application
What the user's app speaks
Data
HTTP, FTP, DNS, SMTP
TCP/IP model has 4 layers: Network Access (Link), Internet, Transport, Application.
TCP vs UDP
TCP
UDP
Connection
Connection-oriented (3-way handshake: SYN → SYN-ACK → ACK)
Connectionless
Reliable?
Yes: ordering, retransmission, flow + congestion control
No guarantee
Speed
Slower
Faster, lower overhead
Used by
HTTP/HTTPS, FTP, SMTP, SSH
DNS queries, video calls, streaming, gaming, DHCP
Ports to memorise
Port
Service
Port
Service
20/21
FTP
53
DNS
22
SSH
67/68
DHCP
23
Telnet
80
HTTP
25
SMTP (send mail)
110 / 143
POP3 / IMAP (receive mail)
443
HTTPS
3306
MySQL
Addresses
IPv4 = 32 bits (4 octets, e.g. 192.168.1.10). IPv6 = 128 bits. MAC = 48 bits (hardware address)
Classes: A 1–126 (default mask /8), B 128–191 (/16), C 192–223 (/24), D 224–239 multicast, E 240–255 reserved. 127.x = loopback (127.0.0.1 = localhost)
HTTP methods: GET (read), POST (create), PUT (replace), PATCH (partial update), DELETE. Status codes: 2xx success (200 OK, 201 Created), 3xx redirect (301), 4xx client error (400, 401 unauthorised, 403 forbidden, 404 not found), 5xx server error (500, 502 bad gateway, 503 unavailable).
Devices and topologies
Hub (L1) sends to everyone. Switch (L2) sends to the right MAC. Router (L3) connects different networks by IP. Gateway connects different protocols
Topologies: Bus, Star (central hub/switch, most common), Ring, Mesh (n(n−1)/2 links), Tree
LAN (building) < MAN (city) < WAN (country / internet)
Traps
IPv4 is 32 bits, IPv6 is 128, MAC is 48.
Switch is Layer 2; router is Layer 3.
DNS mostly uses UDP port 53.
ARP finds the MAC from an IP, not the other way round.
TCP handshake has 3 steps; closing a connection takes 4.
OOPSobject-oriented programming
Class and object
Class = blueprint (Car). Object = an actual thing made from it (my red car). Memory is given to objects, not classes
Constructor: runs automatically when an object is created; same name as the class (C++/Java), __init__ in Python; no return type
Destructor: runs when the object is destroyed (~ClassName in C++)
The 4 pillars
Pillar
Meaning
Example
Encapsulation
Bundle data + methods together and hide the data (private fields, getters/setters)
Bank balance only changed through deposit()
Abstraction
Show what it does, hide how
You press brake; you don't see the hydraulics. Abstract classes, interfaces
Inheritance
A child class reuses a parent class ("is-a")
Dog extends Animal
Polymorphism
One name, many forms
+ adds numbers and joins strings
Polymorphism types
Compile-time (static)
Run-time (dynamic)
Overloading: same method name, different parameters, same class
Overriding: child class redefines the parent's method with the same signature
Also operator overloading
Uses virtual functions (C++), decided at run time
Inheritance types
Single (A→B), Multilevel (A→B→C), Hierarchical (A→B, A→C), Multiple (A,B→C), Hybrid. Java does not allow multiple inheritance of classes (only through interfaces) because of the diamond problem. C++ and Python allow it.
Access specifiers
Specifier
Visible to
private
Only the same class
protected
Same class + child classes
public
Everyone
Default in C++ class = private; in struct = public.
Other terms
Abstract class: can't create objects from it; may have some implemented methods. Interface: only method declarations (a contract)
Static member: belongs to the class, shared by all objects
this (C++/Java) / self (Python): the current object
Virtual function (C++): enables run-time polymorphism. Pure virtual (= 0) makes the class abstract
Friend function (C++): non-member allowed to see private data
Association (uses-a) → Aggregation (has-a, can live apart: Team–Player) → Composition (part-of, dies together: House–Room)
Coupling should be low, cohesion high
Traps
Overloading = compile time; overriding = run time.
Constructors can be overloaded but not inherited, and (in C++) can't be virtual. Destructors can be virtual.
Return type alone can't overload a method.
Data hiding is encapsulation; hiding implementation is abstraction.
DBMSdatabases and SQL
Keys
Key
Meaning
Super key
Any set of columns that uniquely identifies a row
Candidate key
A minimal super key (no extra columns)
Primary key
The candidate key chosen. Unique + NOT NULL, one per table
Alternate key
Candidate keys not chosen as primary
Foreign key
Column that refers to another table's primary key (links tables)
Unique key
Unique, but can be NULL; many per table
Composite key
Key made of 2+ columns
ACID (transactions)
Atomicity: all or nothing
Consistency: database stays valid before and after
Isolation: parallel transactions don't interfere
Durability: once committed, survives a crash
Normalization (remove redundancy)
Form
Rule
1NF
Atomic values: one value per cell, no repeating groups
2NF
1NF + no partial dependency (non-key column depends on the whole key)
3NF
2NF + no transitive dependency (non-key → non-key)
BCNF
Every determinant is a candidate key (stricter 3NF)
SQL command groups
Group
Commands
DDL (structure)
CREATE, ALTER, DROP, TRUNCATE, RENAME
DML (data)
SELECT, INSERT, UPDATE, DELETE
DCL (permissions)
GRANT, REVOKE
TCL (transactions)
COMMIT, ROLLBACK, SAVEPOINT
DELETE vs TRUNCATE vs DROP
DELETE
TRUNCATE
DROP
Removes
Chosen rows (WHERE)
All rows
Whole table + structure
Type
DML
DDL
DDL
Rollback
Yes
Usually no
No
Queries and joins
Order you write: SELECT … FROM … WHERE … GROUP BY … HAVING … ORDER BY …
WHERE filters rows before grouping; HAVING filters groups after (can use COUNT, SUM…)
INNER JOIN: only matching rows. LEFT JOIN: all left + matches (NULL if none). RIGHT: all right. FULL: all from both. CROSS: every pair (m × n rows). Self join: table with itself
LIKE 'a%' starts with a; '_a%' second letter a. IS NULL, never = NULL
Second highest salary: SELECT MAX(salary) FROM emp WHERE salary < (SELECT MAX(salary) FROM emp);
Other terms
ER diagram: entity (rectangle), attribute (oval), relationship (diamond)
Index: speeds up search, slows insert/update. View: a saved query, a virtual table
Immediate (data in instruction: MVI A,05H), Register (MOV A,B), Direct (address in instruction: LDA 2050H), Register indirect (address in a register pair: MOV A,M with HL), Implied (CMA).
8086 segments
CS (code), DS (data), SS (stack), ES (extra). Physical address = segment × 10H + offset (shift segment left by 4 bits, then add).
Traps
8085 = 8-bit data, but 16-bit address (64 KB).
8086 = 16-bit data, 20-bit address (1 MB).
TRAP is the only non-maskable interrupt in 8085.
Parity flag = 1 for even parity.
In MOV B, A the destination comes first.
Digital Principles & COAgates, numbers, the computer inside
Logic gates
Gate
Output 1 when
Expression
AND
all inputs 1
A·B
OR
any input 1
A+B
NOT
input is 0
A'
NAND
NOT all 1 (output 0 only when all inputs 1)
(A·B)'
NOR
all inputs 0
(A+B)'
XOR
inputs different
A⊕B
XNOR
inputs same
(A⊕B)'
NAND and NOR are universal gates: any circuit can be built from only NANDs (or only NORs).
Boolean rules
A + 0 = A, A · 1 = A, A + 1 = 1, A · 0 = 0
A + A = A, A · A = A, A + A' = 1, A · A' = 0
De Morgan: (A·B)' = A' + B' and (A+B)' = A' · B'
Absorption: A + AB = A, A(A + B) = A
K-map: groups of 1, 2, 4, 8 cells to simplify expressions
Number systems
System
Base
Example
Binary
2
1101₂ = 8+4+0+1 = 13
Octal
8
group binary in 3s: 101 011 = 53₈
Decimal
10
43
Hexadecimal
16
group binary in 4s: 0010 1011 = 2B₁₆ (A=10 … F=15)
Decimal → binary: keep dividing by 2, read remainders bottom to top (13 → 1101)
1's complement: flip every bit. 2's complement: flip every bit, then add 1. Used for negative numbers
n bits signed (2's complement) range: −2ⁿ⁻¹ to 2ⁿ⁻¹ − 1 (8 bits: −128 to 127)
BCD: each decimal digit as 4 bits (25 → 0010 0101). Gray code: only one bit changes between consecutive numbers