What is computer science?
Computer science studies how computation works: how to represent problems, design efficient solutions, and build the systems that run them. It sits underneath every programming language and framework.
You do not need a degree to learn it. Many self-taught engineers follow free university courses and books to build the same foundation, which pays off in interviews and in solving hard problems at work.
How to use this Computer Science roadmap
Treat this like a self-paced degree. Study 8 to 10 hours a week, mix theory with coding, and do the problem sets of each course you follow.
You can work on steps 3 and 4 in parallel with step 2 once you are comfortable programming.
1Step 1: Programming fundamentals
Learn to think like a programmer.
What is it?
Start with one language, usually Python or C, and learn how to break problems into steps.
What to learn
Solve small problems daily. Programming is a skill built by repetition.
Learn each topic here
Variables, control flow and functions
The basic building blocks of any program.
Why it matters: Every later topic uses them.
Recursion
Functions that call themselves.
Why it matters: Key to trees, sorting and many algorithms.
Object-oriented and functional styles
Two ways of organising code.
Why it matters: Most languages mix both.
Debugging
Reading errors and using a debugger.
Why it matters: Most programming time is debugging.
Testing
Writing simple tests for your code.
Why it matters: Confidence in correctness.
Example
python
def factorial(n):
if n <= 1:
return 1
return n * factorial(n - 1)
assert factorial(5) == 120A recursive function with a simple test.
Helpful resource: Harvard CS50
2Step 2: Data structures and algorithms
How to solve problems efficiently.
What is it?
Data structures organise data; algorithms process it. Big-O notation measures how solutions scale.
What to learn
Implement each data structure yourself once before using the library version.
Learn each topic here
Big-O notation
Describing time and memory growth.
Why it matters: Compare solutions objectively.
Arrays, linked lists, stacks and queues
Basic linear structures.
Why it matters: Used everywhere.
Hash tables
Fast key-value lookups.
Why it matters: The most useful structure in practice.
Trees and graphs
Hierarchies and networks, with BFS and DFS.
Why it matters: Maps, social networks, file systems.
Sorting and searching
Merge sort, quicksort and binary search.
Why it matters: Classic patterns reused constantly.
Example
python
def binary_search(arr, target):
lo, hi = 0, len(arr) - 1
while lo <= hi:
mid = (lo + hi) // 2
if arr[mid] == target: return mid
if arr[mid] < target: lo = mid + 1
else: hi = mid - 1
return -1Binary search finds an item in a sorted list in O(log n) time.
Helpful resource: MIT 6.006 Introduction to Algorithms
3Step 3: Computer systems
What happens under the code.
What is it?
Learn how computers represent data, run instructions, manage memory and run many programs at once.
What to learn
Learn some C. It shows you memory and pointers in a way higher-level languages hide.
Learn each topic here
Binary and data representation
Bits, bytes, integers, floating point and text encoding.
Why it matters: Explains odd bugs.
Computer architecture
CPU, memory hierarchy, caches.
Why it matters: Performance comes from here.
Operating systems
Processes, threads, scheduling, memory and files.
Why it matters: Every program depends on the OS.
Concurrency
Threads, locks, race conditions.
Why it matters: Modern software is concurrent.
Compilers and interpreters
How code becomes machine instructions.
Why it matters: Understand your tools.
Example
c
#include <stdio.h>
int main(void) {
int x = 42;
int *p = &x;
printf("value=%d address=%p\n", *p, (void*)p);
return 0;
}A pointer holds a memory address; dereferencing reads the value.
Helpful resource: Nand2Tetris
4Step 4: Networks and databases
How computers talk and how data is stored.
What is it?
Networking explains the internet; databases explain how applications keep data safe and queryable.
What to learn
Build a tiny HTTP server once. It ties networking concepts together.
Learn each topic here
Network layers
TCP/IP, DNS and HTTP.
Why it matters: The web runs on them.
Sockets
Low-level network programming.
Why it matters: How servers really work.
Relational databases
Tables, SQL, normalisation.
Why it matters: Most business data.
Transactions and indexes
ACID and query speed.
Why it matters: Correctness and performance.
Distributed basics
Replication, consistency and CAP trade-offs.
Why it matters: Large systems are distributed.
Example
python
import socket
s = socket.socket(); s.bind(("0.0.0.0", 8080)); s.listen()
while True:
conn, _ = s.accept(); conn.recv(1024)
conn.sendall(b"HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\n\r\nHello")
conn.close()A minimal HTTP server using raw sockets.
Helpful resource: CMU Database Systems course
5Step 5: Theory and maths
The ideas that tell you what is possible.
What is it?
Discrete maths, logic, probability, automata and complexity theory give precise tools for reasoning about programs.
What to learn
Do the exercises. Maths is learned by solving, not reading.
Learn each topic here
Discrete mathematics
Sets, logic, proofs, combinatorics and graphs.
Why it matters: Foundation of algorithms.
Probability
Expected value and distributions.
Why it matters: Randomised algorithms, ML and testing.
Automata and languages
Finite automata, regular expressions and grammars.
Why it matters: Parsers and regex.
Computability
What computers can and cannot solve.
Why it matters: Know the limits.
Complexity classes
P, NP and NP-complete problems.
Why it matters: Spot problems with no fast exact solution.
Example
text
Proof by induction: 1 + 2 + ... + n = n(n+1)/2
Base: n=1 -> 1 = 1(2)/2 ✓
Step: assume true for n.
Then 1+...+n+(n+1) = n(n+1)/2 + (n+1) = (n+1)(n+2)/2 ✓A short induction proof, the core tool for proving algorithms correct.
Helpful resource: MIT Mathematics for Computer Science
6Step 6: Advanced topics and specialisation
Expert level: go deep in one area.
What is it?
After the core, choose depth: distributed systems, compilers, security, machine learning, graphics or systems programming.
What to learn
Read classic papers in your chosen area. They explain why systems are built the way they are.
Learn each topic here
Distributed systems
Consensus, replication, fault tolerance.
Why it matters: How the cloud works.
Compilers
Parsing, type checking and code generation.
Why it matters: Deep language understanding.
Security
Cryptography, secure systems design.
Why it matters: Every system is a target.
Machine learning
Linear algebra, optimisation and models.
Why it matters: A fast-growing field.
Software design at scale
Architecture, abstraction and system design.
Why it matters: Senior engineering skill.
Example
text
Raft consensus in brief
- One leader per term, chosen by majority vote
- Leader appends log entries and replicates to followers
- Entry committed once a majority stores it
- If leader fails, followers time out and elect a new oneThe core idea of the Raft algorithm used by etcd and many databases.
Helpful resource: Teach Yourself Computer Science
Computer Science roadmap project ideas
Keep all CS projects in one GitHub repo with notes. It works as proof of a self-taught degree.
CLI to-do app
Tested Python app with file storage.
Data structure library
Your own stack, queue and hash map.
Unix shell
A C shell with pipes and redirects.
HTTP server
Raw-socket server serving static files.
Key-value store
Networked database with logging and recovery.
Raft or compiler
A capstone with a technical write-up.
Tips to finish this computer science roadmap
- Follow a curriculum. Use a structured list such as OSSU or Teach Yourself CS.
- Code what you learn. Theory sticks when you build it.
- Study in a group. Accountability helps long-term learning.
- Be patient. A CS foundation takes over a year; it lasts a career.
Career paths and next steps
Strong CS fundamentals help in every software role and are essential for big tech interviews, systems programming, compilers, databases and research. They also make learning new languages and frameworks much faster.
Next, apply your knowledge with system design and a specialisation roadmap.
Related roadmaps
Computer Science Roadmap FAQs
Can I learn computer science without a degree?
Yes. Free courses from MIT, Harvard and others cover most of a CS degree.
How long does it take to learn computer science?
A solid foundation takes 12 to 18 months of part-time study.
Do I need maths for computer science?
Yes, mainly discrete maths, some probability and linear algebra for certain areas.
Is computer science the same as programming?
No. Programming is one part. CS also covers algorithms, systems, theory and design.