← Courses

CS 320 · 3 credits

Course Outline

How Computers Work

How does a computer actually run your code? This course builds the mental models every software engineer needs: what the CPU, RAM, and disk each do, how data becomes bits, what a process really is (and how signals stop one), why programs crash, how virtual memory keeps processes apart, how threads race, deadlock, and how locks save them, what file permissions guard, and what happens between your print() and the screen. Hands-on in Python and the terminal, no kernel source code required.

What you will learn

  • Explain what the CPU, RAM, disk, and operating system each do, and trace the fetch-decode-execute cycle
  • Read and write binary, hex, and bytes, explain why 0.1 + 0.2 ≠ 0.3, and debug text-encoding problems
  • Describe processes, PIDs, exit codes, and signals (SIGTERM vs SIGKILL), and build a graceful shutdown handler
  • Explain memory layout (stack vs heap), virtual memory and page faults, and diagnose crashes like stack overflow and out-of-memory
  • Demonstrate a race condition and a deadlock in Python threads, and fix them with locks and lock ordering
  • Explain scheduling, context switches, file buffering, permissions, and system calls, and trace the full story of running a program

Course outline

Unit 1The Big Picture: CPU, RAM, Disk, and the OS

  • 1-1The three parts of every computer4 checks · 10 min
  • 1-2The fetch-decode-execute cycle3 checks · 12 min
  • 1-3The operating system: the manager4 checks · 8 min

Unit 2Data Is Bits: Binary, Floats, and Text

  • 2-1Binary and bytes5 checks · 11 min
  • 2-2Why 0.1 + 0.2 is not 0.34 checks · 12 min
  • 2-3Text is bytes too: encodings5 checks · 12 min

Unit 3Programs and Processes

  • 3-1What "running a program" really means3 checks · 10 min
  • 3-2PIDs: how the OS names processes4 checks · 9 min
  • 3-3Birth, death, and exit codes4 checks · 11 min
  • 3-4Signals: how the OS interrupts a process4 checks · 10 min

Unit 4Memory: Stack, Heap, and Why Programs Crash

  • 4-1The stack and the heap4 checks · 12 min
  • 4-2Why programs crash5 checks · 11 min
  • 4-3Garbage collection, gently3 checks · 10 min
  • 4-4Virtual memory: every process gets its own map4 checks · 12 min

Unit 5Threads, Race Conditions, and Locks

  • 5-1Threads vs processes4 checks · 11 min
  • 5-2Race conditions4 checks · 12 min
  • 5-3Locks: one at a time, please3 checks · 11 min
  • 5-4Deadlock: the standstill4 checks · 10 min

Unit 6Scheduling: Why Your Machine Feels Parallel

  • 6-1The scheduler: taking turns very fast4 checks · 12 min
  • 6-2Context switches, waiting, and the cost of it all4 checks · 11 min

Unit 7Files and Filesystems

  • 7-1What a file really is4 checks · 11 min
  • 7-2Buffers and flushing3 checks · 11 min
  • 7-3Directories, metadata, and sizes4 checks · 10 min
  • 7-4Permissions: who may touch a file3 checks · 10 min

Unit 8System Calls: The Boundary

  • 8-1User space and kernel space3 checks · 11 min
  • 8-2What actually happens when you print()5 checks · 11 min

Unit 9Putting It Together: Running a Program, Start to Finish

  • 9-1The full trace: python3 hello.py3 checks · 12 min
  • 9-2Capstone: build a mini process inspector3 checks · 14 min

Practice while you learn

Use Hack University's public online code editor when you want to run code online before committing to the full curriculum. The browser compilers are free for quick syntax checks, exercises, and interview practice in an isolated sandbox environment.