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.
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.
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'.
| Operation | Rough order | What it implies |
|---|---|---|
| L1 cache reference | ~1 ns | Data layout and cache locality are real optimisations |
| Main memory reference | ~100 ns | A 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 ms | Fine occasionally, ruinous in a loop |
| Disk seek (spinning) | ~10 ms | Why sequential I/O and log-structured storage exist |
| Cross-continent round trip | ~150 ms | Physics. No amount of server tuning removes it — only fewer round trips or closer servers do |
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.
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.
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.
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.
(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.Every tutorial starts with a plain-English analogy — then real code, then interview questions.
Browse CS Fundamentals Tutorials →