LATESTSSC CGL 2026 Notification Live | ISRO Scientist 'SC' Interview Shortlists Out | NIC Scientist B Active
InterviewJobs.in
Computer Science Fundamentals for Technical Interviews: OS, DBMS, Networks & OOP
Guide #4Software Engineering & IT 25 min read Updated: September 2026

Computer Science Fundamentals for Technical Interviews: OS, DBMS, Networks & OOP

The ultimate technical reference for cracking core computer science rounds: Process synchronization, virtual memory, B+ trees, ACID guarantees, TCP/IP handshakes, and SOLID design principles.
Many candidates excel at coding puzzles but stumble when interviewers interrogate low-level computer science principles. This guide breaks down the four core pillars of computer science—Operating Systems, Database Management Systems, Computer Networks, and Object-Oriented Programming—explaining the engineering mechanics behind memory, transactions, network packets, and clean code.
Target Audience: Engineering college freshers, campus placement candidates, SDE-1, and experienced engineers revising fundamental CS theory for tech interviews.
Pillar: Software Engineer Interview Preparation 2026 →

What You'll Learn in This Masterclass

Operating Systems: Processes vs Threads, Context Switching, CPU scheduling, and Virtual Memory paging.
Concurrency & Locks: Mutex vs Semaphore, race conditions, and resolving the 4 Coffman deadlock conditions.
DBMS & SQL: Storage engines, B+ Tree indexing mechanics, transaction isolation anomalies, and normalization.
Computer Networks: The OSI and TCP/IP models, TCP 3-way handshake, UDP, DNS resolution, and HTTP/2 vs HTTP/3.
Object-Oriented Programming: Encapsulation, Polymorphism, Abstraction, and the 5 SOLID design principles.
High-frequency interview questions with structured, conceptual answers that impress technical interviewers.

Core CS Fundamentals Quick Reference Matrix

Core SubjectHighest-Yield TopicsCommon Interview QuestionKey Concept / Mechanism
Operating SystemsProcess vs Thread, Deadlocks, Paging, Virtual MemoryWhat actually happens during a process context switch?CPU registers and PC are saved; kernel switches page table pointer; TLB is flushed.
DBMSACID, B+ Tree Indexing, Isolation Levels, NormalizationWhy are B+ Trees preferred over Binary Search Trees for disk storage?High fan-out minimizes disk I/O seeks; leaf nodes form a linked list for rapid range scans.
Computer NetworksTCP Handshake, DNS Flow, HTTP/1.1 vs 2 vs 3, SubnettingExplain step-by-step what happens when you type google.com into your browser.DNS query -> TCP 3-way handshake -> TLS negotiation -> HTTP GET -> Server processing -> DOM rendering.
OOP & Clean CodeInheritance vs Composition, Polymorphism, SOLID principlesExplain Liskov Substitution Principle with a real-world code violation.A derived class must be completely substitutable for its parent without breaking program correctness (e.g., Square inheriting from Rectangle).

Visual Architecture & Process Diagrams

The Four Pillars of Computer Science Technical InterviewsArchitecture Blueprint
OPERATING SYSTEMS • Processes vs Threads • Concurrency & Mutex • Deadlock 4 Conditions • Virtual Memory & Paging • TLB & Context Switch DBMS & STORAGE • ACID Transaction Core • B+ Tree Index Internals • 4 Isolation Levels • 1NF to BCNF Normalization • SQL Query Optimization NETWORKS & WEB • OSI & TCP/IP Stack • TCP 3-Way Handshake • UDP vs TCP Trade-offs • TLS / HTTPS Handshake • HTTP/1.1 vs 2 vs 3 (QUIC) OOP & CLEAN CODE • 4 Pillars: Encapsulation etc. • S.O.L.I.D Principles • Composition vs Inheritance • Creational Patterns (Factory) • Behavioral Patterns (Strategy)

Visual synthesis of Operating Systems, DBMS, Computer Networks, and Object-Oriented Programming interview topics.

1. Operating Systems: Memory, Concurrency & Deadlocks

Operating systems govern hardware allocation. Technical interviewers focus on what happens beneath user-space code.

Processes vs. Threads

  • Process: An executing instance of a program with its own independent, isolated virtual memory address space (Text, Data, Heap, Stack). Inter-Process Communication (IPC) requires OS primitives: Pipes, Shared Memory, or Sockets.
  • Thread: A lightweight unit of execution within a process. Threads of the same process share the same code, heap, and open file descriptors, but maintain their own private Stack and Program Counter (PC).

The 4 Coffman Conditions for Deadlock

A deadlock occurs when a set of concurrent processes are blocked because each process is holding a resource and waiting for another resource held by some other process. All 4 conditions must hold simultaneously:

  1. 1
    Mutual Exclusion: At least one resource must be held in a non-shareable mode.
  2. 2
    Hold and Wait: A process is holding at least one resource and waiting to acquire additional resources held by others.
  3. 3
    No Preemption: Resources cannot be forcibly confiscated; they can only be released voluntarily.
  4. 4
    Circular Wait: A closed chain of processes exists such that each process holds a resource needed by the next.

Eliminating Circular Wait by enforcing a strict global numerical ordering on all system resources is the most practical deadlock prevention strategy in modern software.

2. DBMS: ACID Guarantees, B+ Tree Indexing & Isolation Levels

Why B+ Trees Rule Disk-Based Databases

Binary Search Trees (BSTs) and Red-Black trees have low fan-out (2 children per node). For 1 million records, a BST requires ~20 levels of depth. If each node lookup requires a disk read, traversing the tree takes 20 expensive disk I/O operations.

In contrast, a B+ Tree has a high fan-out (e.g., 100 to 1,000 children per node). A 3-level B+ Tree can store 1 billion keys with only 3 disk I/O operations! Furthermore, all data records are stored exclusively in the leaf nodes, which are linked together in a doubly-linked list, allowing blazing-fast range queries (WHERE age BETWEEN 25 AND 35).

The 4 Transaction Isolation Levels (SQL-92 Standard)

  • Read Uncommitted: Allows Dirty Reads (reading uncommitted changes of another transaction).
  • Read Committed: Prevents Dirty Reads, but allows Non-Repeatable Reads (rereading the same row produces different values).
  • Repeatable Read: Prevents Dirty and Non-Repeatable Reads, but may allow Phantom Reads (new rows inserted by another transaction matching the query filter). Default in MySQL InnoDB.
  • Serializable: Strict isolation simulating serial execution; locks ranges of rows or uses Snapshot Isolation with conflict detection.

3. Computer Networks: TCP/IP, DNS & HTTP Evolution

The TCP 3-Way Handshake

  1. 1
    Client -> Server (SYN): Client chooses an Initial Sequence Number (ISN_c) and sends a TCP segment with SYN flag set. State: SYN-SENT.
  2. 2
    Server -> Client (SYN-ACK): Server acknowledges client ISN (ACK = ISN_c + 1), chooses its own ISN_s, and sets SYN and ACK flags. State: SYN-RECEIVED.
  3. 3
    Client -> Server (ACK): Client acknowledges server ISN (ACK = ISN_s + 1). State: ESTABLISHED. Data transmission can now begin.

HTTP/1.1 vs HTTP/2 vs HTTP/3

  • HTTP/1.1: Persistent TCP connections, but suffers from application-layer Head-of-Line (HoL) blocking (requests on a single connection must be served in strict FIFO order).
  • HTTP/2: Introduces binary framing and multiplexing over a single TCP stream. Multiple concurrent request-response streams share one connection. However, transport-layer packet loss still blocks all streams (TCP-level HoL blocking).
  • HTTP/3: Replaces TCP with QUIC (built on top of UDP). Each stream is truly independent; packet loss on one stream does not stall data on other streams.

4. Object-Oriented Design & The SOLID Principles

The 5 SOLID principles guide clean software development and code maintainability:

  • S - Single Responsibility: Every module or class should be responsible for only one actor or reason to change.
  • O - Open/Closed: Classes should be open for extension (via polymorphism and interfaces) but closed for modification.
  • L - Liskov Substitution: Derived classes must be substitutable for base classes without altering correct behavior.
  • I - Interface Segregation: Clients should not be forced to depend on interfaces they do not use (prefer small, role-specific interfaces).
  • D - Dependency Inversion: Depend upon abstractions (interfaces), not concrete implementations. Inversion of Control (IoC) frameworks inject dependencies at runtime.

High-Frequency Interview Questions & Frameworks

Q1

What is the fundamental difference between a Mutex and a Counting Semaphore in kernel-level programming?

What the Interviewer is Testing:Thread synchronization mechanics, understanding ownership semantics, and priority inversion prevention.
Strategic Approach:Highlight the difference in ownership: A Mutex has an owner (the thread that locked it must unlock it). A Semaphore is a signaling mechanism with an integer counter (any thread can signal/post to wake up waiting threads). Mention Priority Inheritance in Mutexes.
Answer Framework:Definition & States -> Ownership Semantics -> Signaling vs Locking -> Priority Inversion Handling -> Code Example Context.
Sample Model Answer:
A Mutex is a mutual exclusion locking primitive with strict ownership: only the thread that acquired the mutex is permitted to release it. It has two states: locked (0) and unlocked (1). Because of ownership, modern kernels implement Priority Inheritance on mutexes to prevent priority inversion. In contrast, a Counting Semaphore is a signaling primitive with an integer counter initialized to N. Any thread can invoke wait() (decrement counter) or signal() (increment counter). A semaphore does not have an owner—Thread A can wait on a task, and Thread B can signal when data is ready. Thus, a binary semaphore is not simply a mutex without priority inheritance; their design intent is fundamentally different.
Common Mistake: Saying "A mutex is just a semaphore with count 1", which overlooks ownership semantics and priority inheritance mechanisms.
How to Personalize: Mention how you handled thread safety in production using language primitives (e.g., synchronized blocks in Java or Mutex/RWMutex in Go).
Q2

Explain what happens under the hood when a database executes a query on an indexed column vs an unindexed column.

What the Interviewer is Testing:Database storage mechanics, disk page reads, B+ Tree traversal vs full table scan (sequential scan), and query planner execution paths.
Strategic Approach:Explain the physical storage layout (pages on disk). Without an index: Full Table Scan reading every data block into memory buffer pools. With an index: B+ Tree search from root to leaf, fetching row pointers (Record IDs / ctid), followed by an index scan or index-only scan.
Answer Framework:Storage Page Basics -> Unindexed Execution (Full Table Scan) -> Indexed Execution (B+ Tree Traversal) -> Index-Only Scan optimization -> Cost trade-off on writes.
Sample Model Answer:
On an unindexed column, the database query planner executes a Full Table Scan (Sequential Scan). The engine reads every data page from disk into RAM buffer pools, examining row by row in O(N) time, which causes massive disk I/O on large tables. On an indexed column, the database traverses a B+ Tree index. Starting at the root node, it compares keys and follows child pointers down to the leaf node in O(log N) operations (typically 3-4 page reads). The leaf node yields a tuple pointer (PageID, Offset) pointing to the physical row in the table heap. If the query only selects columns that are already part of the index, the engine performs an "Index-Only Scan", bypassing table heap reads entirely. The trade-off is write amplification: every INSERT or UPDATE on the table requires updating the B+ Tree structure.
Common Mistake: Failing to mention that indexes slow down write operations (INSERT/UPDATE/DELETE) due to tree rebalancing and page splits.
How to Personalize: Share an example where analyzing an EXPLAIN ANALYZE plan or adding a composite index reduced query latency in your own application.

Costly Mistakes to Avoid

  • ✕
    Confusing processes with threads and claiming threads have separate virtual memory address spaces.
  • ✕
    Overlooking that B+ Tree leaf nodes are connected via a linked list for range queries.
  • ✕
    Assuming HTTPS encrypts the IP address and port (only the HTTP payload, URL path, and headers are encrypted; destination IP is visible for routing).
  • ✕
    Violating Liskov Substitution by throwing NotImplementedException in subclasses.
  • ✕
    Believing garbage collection eliminates all memory leaks (dangling references in static collections still leak memory).

Key Takeaways

  • •CS fundamentals separate code monkeys from true software engineers who can debug production systems.
  • •B+ Trees minimize disk I/O fan-out, making them the optimal data structure for database storage engines.
  • •TCP guarantees reliable, ordered byte streams via sequence numbers, checksums, and sliding windows.
  • •The SOLID principles ensure that software remains adaptable and maintainable over years of codebase growth.

Final Interview Checklist

  • Be able to trace the 4 Coffman conditions and explain circular wait prevention on a whiteboard.
  • Understand virtual memory, page faults, and how the TLB cache accelerates address translation.
  • Know all 4 SQL isolation levels and their corresponding concurrency anomalies (Dirty, Non-repeatable, Phantom).
  • Be able to draw the TCP 3-way handshake and 4-way connection teardown with state diagrams.
  • Explain how TLS 1.3 optimizes the handshake down to 1-RTT compared to 2-RTT in TLS 1.2.
  • Be able to write clean code illustrating each of the 5 SOLID principles.

Frequently Asked Questions (FAQs)

What is the difference between synchronous and asynchronous I/O?

In synchronous I/O, the calling thread is blocked until the I/O operation (such as reading a file or network socket) completes and data is transferred to the user buffer. In asynchronous I/O (e.g., epoll, kqueue, io_uring), the thread initiates the request and immediately continues execution; the kernel notifies the application via callbacks or event loops when the I/O operation finishes.

What is a race condition, and how is it prevented?

A race condition occurs when multiple threads concurrently read and write shared data, and the final outcome depends on the non-deterministic order of thread execution. Prevent it using mutual exclusion locks (Mutex), atomic operations (CAS - Compare-And-Swap), or thread-safe data structures.

What is the purpose of database normalization, and why do companies denormalize?

Normalization (1NF, 2NF, 3NF, BCNF) organizes tables to eliminate data redundancy and prevent update/insertion anomalies. However, normalized schemas require expensive multi-table JOIN operations at scale. Companies intentionally denormalize read-heavy tables to store precomputed join data, trading disk space for query speed.

How does DNS lookup work from start to finish?

When resolving a domain name: 1. Browser checks local cache. 2. OS resolver queries local DNS Resolver (ISP/Router). 3. Resolver queries Root Nameserver (.), which returns the TLD Nameserver (.com). 4. Resolver queries TLD Nameserver, which returns the Authoritative Nameserver. 5. Authoritative Nameserver returns the IP address record (A/AAAA). 6. Resolver caches the record based on TTL.

What is the difference between overloading and overriding in OOP?

Method Overloading (Compile-time Polymorphism) occurs when multiple methods in the same class share the same name with different parameter signatures. Method Overriding (Runtime Polymorphism) occurs when a subclass provides a specific implementation of a method already defined in its superclass, resolved at runtime via virtual method tables (vtables).

What is the difference between TCP and UDP?

TCP is connection-oriented, reliable, and ordered (handles packet retransmissions, flow control, and congestion control). UDP is connectionless, lightweight, and unordered (sends datagrams with minimal header overhead, ideal for live video streaming, DNS, and online gaming where low latency beats perfect reliability).

What is a memory leak, and how does it happen in garbage-collected languages?

A memory leak occurs when memory allocated by a program is no longer needed but cannot be freed. In garbage-collected languages (like Java, Python, Go), memory leaks occur when unused objects are inadvertently retained by active references (e.g., static collections, unclosed streams, or unremoved event listeners).

What is the difference between optimistic and pessimistic locking in databases?

Pessimistic locking assumes conflicts will happen and locks rows immediately on read (SELECT ... FOR UPDATE), blocking other transactions. Optimistic locking assumes conflicts are rare; it does not lock rows on read, but records a version number. On write, it checks if the version has changed; if yes, the transaction aborts and retries.

All Operating System, DBMS, and Network protocol definitions are strictly compliant with POSIX, SQL-92, and IETF RFC standards. Read our complete Disclaimer Policy.

Explore Related Knowledge Guides

Software Engineering & IT24 min read

Software Engineer Interview Preparation 2026: Complete Roadmap from Coding to System Design

An end-to-end masterclass blueprint covering DSA problem-solving patterns, computer science fundamentals, low-level and high-level system design, production project defense, and behavioral interview strategies for product firms and tech giants.

Read Strategy →
Software Engineering & IT26 min read

Data Structures and Algorithms Interview Guide: Topics, Patterns & Practice Roadmap

A systematic, pattern-first blueprint to conquering coding interviews: Arrays, Linked Lists, Trees, Graphs, Dynamic Programming, and the 17 algorithmic patterns that solve 85%+ of interview problems.

Read Strategy →
Software Engineering & IT28 min read

System Design Interview Guide: Complete Preparation Roadmap with Real Examples

An exhaustive masterclass on architecting planetary-scale distributed systems: Microservices, Caching, Partitioning, Consistent Hashing, CAP theorem trade-offs, and step-by-step real-world case studies.

Read Strategy →