Home› CS Fundamentals› Complete Guide
Complete Guide

Complete CS Fundamentals Tutorial

The CS fundamentals are what separate developers who understand their tools from those who just use them. This guide covers all 76 CS Fundamentals topics on TheCodeForge — OS, networking, DBMS and compiler design.

Learning Roadmap
Beginner → Understand how operating systems manage processes and memory
Intermediate → Learn networking protocols, database internals and compiler basics
Advanced → Connect the dots between hardware, OS and the software you write
76
Topics
21
Beginner
35
Intermediate
20
Advanced
Jump to section
Operating Systems (12)Computer Networks (22)DBMS (11)Compiler Design (9)Software Engineering (16)Productivity Tools (3) (1)Strings (1)Performance (1)

There is a specific moment when fundamentals stop feeling academic. It is usually the first time a service falls over and the answer is not in the application code — the container was killed by the OOM killer, the connection pool exhausted because sockets sat in TIME_WAIT, the database ground to a halt on a lock nobody could see. None of those are framework problems, and no amount of framework knowledge solves them.

That is what this track is for. Operating systems, networking, database internals and compilers are not four separate subjects but four views of the same machine, and the engineers who debug hard problems quickly are the ones who can move between the views.

The latency numbers that shape every design

Orders of magnitude matter more than exact figures, and they explain most performance advice you will ever receive. The gap between a CPU cache hit and a cross-continent network round trip is roughly eight orders of magnitude — which is why caching works, why chatty APIs are slow regardless of how fast each call is, and why an N+1 query is fatal even when every query is 'fast'.

OperationRough orderWhat it implies
L1 cache reference~1 nsData layout and cache locality are real optimisations
Main memory reference~100 nsA cache miss costs ~100× a hit — why arrays beat linked lists for traversal
SSD random read~100 µs~1,000× memory; keep the working set in RAM
Same-datacenter round trip~0.5 msFine occasionally, ruinous in a loop
Disk seek (spinning)~10 msWhy sequential I/O and log-structured storage exist
Cross-continent round trip~150 msPhysics. No amount of server tuning removes it — only fewer round trips or closer servers do
In practiceThe practical reading: reducing the number of round trips almost always beats making each one faster. That single principle explains batching, pipelining, HTTP/2 multiplexing, CDNs, connection pooling and DataLoader — one idea wearing six costumes.

Processes, threads and the thing that actually blocks

A process owns an address space; threads share one. That single difference produces everything else: threads are cheap to create and can corrupt each other, processes are isolated and expensive to coordinate. Context switching between threads is cheaper than between processes, but neither is free — and a system spending more time switching than working is thrashing.

The concept that matters most in practice is blocking. A thread blocked on I/O consumes no CPU but does consume a thread, and threads are a bounded resource. That is the whole argument for async I/O: not that it is faster per operation, but that it lets one thread have thousands of operations outstanding. It is also why blocking inside an async runtime is so damaging — it removes a thread from a pool sized on the assumption that nothing blocks.

Networking: the four layers you will actually debug

The seven-layer model is a teaching device. In practice failures cluster into four questions, and asking them in order resolves most network problems faster than any tool.

Can it resolve? DNS, including caching and TTLs that keep a stale record alive after a cutover. Can it connect? TCP — routing, firewalls, security groups, a listener bound to loopback instead of all interfaces. Can it negotiate? TLS — certificate chain, expiry, hostname match, protocol and cipher overlap. Can it understand? HTTP — status codes, headers, timeouts, keep-alive.

Each layer has its own tool, and going in order stops you from debugging an application error that is really a DNS problem.

bash
# 1. Resolution - and is anything caching an old answer?
dig +short api.example.com
dig +trace api.example.com | tail -5

# 2. Connection - can a TCP session be established at all?
nc -vz api.example.com 443
ss -tan | awk '{print $1}' | sort | uniq -c    # TIME_WAIT / CLOSE_WAIT counts

# 3. TLS - chain, expiry, hostname, negotiated version
openssl s_client -connect api.example.com:443 -servername api.example.com </dev/null \
  | openssl x509 -noout -subject -issuer -dates

# 4. HTTP - timing broken down by phase
curl -w '\ndns %{time_namelookup}  tcp %{time_connect}  tls %{time_appconnect}\
  ttfb %{time_starttransfer}  total %{time_total}\n' -o /dev/null -s https://api.example.com

A large stack of CLOSE_WAIT sockets means your application is not closing connections it was told to close — a file-descriptor leak that eventually exhausts the process limit. A large stack of TIME_WAIT is usually normal, and is the kernel doing its job after you closed.

Why database internals show up in application bugs

Three database concepts explain a surprising share of production incidents. Indexes are usually B-trees, which is why a query can use an index on (a, b) to filter by a or by a, b but not by b alone — the leftmost-prefix rule. Isolation levels decide which anomalies you can observe, and the default is rarely the strictest. Locking is where throughput goes to die, usually through transactions held open across a network call.

That last one is worth stating plainly, because it is the most common self-inflicted database outage: a transaction opened, an HTTP request made inside it, and every row it touched locked for the duration. Under load the lock queue grows faster than it drains and the database appears to stop.

Frequently Asked Questions

Do I need CS fundamentals if I only write application code?
You need them precisely when application-level thinking stops working, and that moment always arrives. Every serious production problem — a memory limit, a connection pool, a lock, a timeout, a cache — is a fundamentals problem wearing an application's error message. You can go years without them and then lose a week to one incident.
What is the difference between concurrency and parallelism?
Concurrency is a structure: several tasks in progress, interleaved, possibly on one core. Parallelism is an execution property: several tasks literally running at once on several cores. Async I/O gives you concurrency without parallelism, which is exactly right for I/O-bound work; CPU-bound work needs actual parallelism, which is why threads and processes still matter.
Why does my container get OOM-killed when the process seems fine?
The kernel's OOM killer acts on the cgroup's total memory, which includes page cache and every thread's stack, not just your heap. A JVM or Node process sized against the container limit with no headroom will be killed even though its own heap metrics look healthy. Set the runtime's maximum heap below the container limit, leaving room for everything else.
What is the leftmost-prefix rule, in one sentence?
A composite index on (a, b, c) can serve queries filtering on a, on a, b, or on a, b, c, but not queries that filter only on b or c — because the B-tree is ordered by a first, so without it there is no range to seek into.
How much operating systems knowledge is enough for a backend engineer?
Enough to answer four questions about a running process: how much memory is it using and what kind, what is it blocked on, how many file descriptors does it hold, and where is its CPU time going. If you can get those four answers on a machine you have not seen before, you have enough.
Are compilers worth studying if I will never write one?
The parsing half, moderately. The rest, yes — because compiler concepts explain things you meet constantly: why a stack trace looks the way it does, what an optimiser is allowed to assume about your code (see undefined behaviour), why JIT warmup exists, and what a source generator or macro actually does. It is the subject that most often turns 'magic' into mechanism.

Operating Systems

Computer Networks

DBMS

Compiler Design

Software Engineering

Productivity Tools

Strings

Performance

Also Explore
DSA 197 tutorials → Rust 26 tutorials → Database 144 tutorials → DevOps 310 tutorials → Security 16 tutorials → Observability 10 tutorials →
Start from the beginning

Every tutorial starts with a plain-English analogy — then real code, then interview questions.

Browse CS Fundamentals Tutorials →