Skip to main content

Learning path · Intermediate

Computer science foundations

Data structures, classic algorithms and what really happens when code runs.

The toolkit behind every program and every coding interview: measuring code, the structures that hold data, the algorithms that search and sort it, and the machine underneath.

42 pages4 chaptersabout 1.5 hours of reading

  • Programming Fundamentals
  • Data Structures
  • Operating Systems

Not started yet0/42 read

Start with Algorithm

Progress comes from your reading history, kept only in this browser.

Chapter 1Measuring code

  1. 1AlgorithmProgramming Fundamentals, p. 2An algorithm is a finite, step-by-step set of instructions for solving a problem or completing a task, such as sorting a list or finding the shortest route.
  2. 2Big O NotationProgramming Fundamentals, p. 6Big O notation describes how an algorithm's running time or memory use grows as its input gets larger, focusing on the growth rate rather than exact speed.
  3. 3RecursionProgramming Fundamentals, p. 48Recursion is a technique in which a function solves a problem by calling itself on smaller versions of the same problem until it reaches a simple base case.
  4. 4Divide and ConquerData Structures, p. 13Divide and conquer is an algorithm design technique that splits a problem into smaller independent parts, solves each recursively, and combines the results.

Chapter 2Data structures

  1. 5ArrayProgramming Fundamentals, p. 3An array is an ordered collection of values stored under one name, where each item is accessed by its numeric position, called an index, usually starting at 0.
  2. 6Linked ListData Structures, p. 22A linked list is a data structure that stores items in separate nodes, where each node holds a value and a reference to the next node in the chain.
  3. 7StackData Structures, p. 31A stack is a data structure that stores items in last in, first out (LIFO) order, so the most recently added item is always the first one removed.
  4. 8QueueData Structures, p. 26A queue is a data structure that stores items in first in, first out (FIFO) order, so the item that has waited longest is always the next one removed.
  5. 9Hash TableData Structures, p. 18A hash table is a data structure that stores key-value pairs and uses a hash function to find the value for any key in constant time on average.
  6. 10SetData Structures, p. 28A Set is a collection that stores each distinct value at most once and can check whether a value is present very quickly, usually in constant time.
  7. 11TreeData Structures, p. 33A tree is a hierarchical data structure made of nodes connected by edges, with a single root node at the top and child nodes branching out below it.
  8. 12Binary Search TreeData Structures, p. 6A binary search tree is a binary tree in which each node's left subtree holds smaller values and its right subtree larger ones, enabling fast ordered lookups.
  9. 13HeapData Structures, p. 19A heap is a tree-based data structure that keeps the smallest or largest item at its root, so you can read it in O(1) and remove it in O(log n) time.
  10. 14Priority QueueData Structures, p. 25A priority queue is a collection in which every item has a priority, and the highest-priority item is always removed first, no matter when it was added.
  11. 15GraphData Structures, p. 15A graph is a data structure made of nodes, called vertices, connected by edges, and is used to model relationships such as roads, friendships, and dependencies.

Chapter 3Classic algorithms

  1. 16Linear SearchData Structures, p. 21Linear search finds a value by checking each element of a list one by one from the start until it finds a match or reaches the end, taking O(n) time.
  2. 17Binary SearchData Structures, p. 5Binary search is an algorithm that finds a value in a sorted list by repeatedly halving the search range, taking O(log n) time instead of checking every item.
  3. 18Two PointersData Structures, p. 35The two pointers technique walks an array or list with two indexes moved by simple rules, turning many problems that seem to need nested loops into one pass.
  4. 19Sliding WindowData Structures, p. 29The sliding window technique solves problems on contiguous parts of an array or string by updating a window as it slides instead of recomputing each subarray.
  5. 20Sorting AlgorithmData Structures, p. 30A sorting algorithm is a step-by-step method for arranging items in a defined order, such as numbers from smallest to largest or names alphabetically.
  6. 21Bubble SortData Structures, p. 9Bubble sort is a simple sorting algorithm that keeps swapping out-of-order neighbors, so each pass carries the largest remaining value to the end.
  7. 22Insertion SortData Structures, p. 20Insertion sort builds a sorted list one element at a time, putting each new one in its place among those already sorted, like sorting cards in your hand.
  8. 23Merge SortData Structures, p. 24Merge sort is a divide and conquer sorting algorithm that splits a list in half, sorts each half recursively, and merges the sorted halves in O(n log n) time.
  9. 24QuicksortData Structures, p. 27Quicksort is a divide and conquer sorting algorithm that partitions items around a chosen pivot, then sorts the smaller and larger groups the same way.
  10. 25Breadth-First SearchData Structures, p. 8Breadth-first search is a graph traversal algorithm that visits nodes in order of their distance from the start, exploring all neighbors before going deeper.
  11. 26Depth-First SearchData Structures, p. 10Depth-first search is a graph traversal algorithm that follows one path as far as it can go before backtracking to explore the next unvisited branch.
  12. 27Dijkstra's AlgorithmData Structures, p. 12Dijkstra's algorithm is a graph algorithm that finds the shortest paths from a starting node to every other node when all edge weights are zero or positive.
  13. 28Dynamic ProgrammingData Structures, p. 14Dynamic programming is a technique for solving problems by breaking them into overlapping subproblems and storing each answer so none is solved twice.
  14. 29Greedy AlgorithmData Structures, p. 16A greedy algorithm builds a solution step by step, always taking the choice that looks best right now, without going back to reconsider earlier decisions.
  15. 30Union-FindData Structures, p. 36Union-find, or disjoint set union, is a data structure that tracks which elements share a group and can merge groups or check connectivity almost instantly.

Chapter 4Under the hood

  1. 31Operating SystemOperating Systems, p. 21An operating system (OS) is the core software that manages a computer's hardware, shares it out among programs and gives them a common way to use it.
  2. 32CPUOperating Systems, p. 4A CPU (central processing unit) is the processor that executes a program's instructions, doing the arithmetic, logic and control work all software runs on.
  3. 33RAMOperating Systems, p. 25RAM (random access memory) is a computer's fast, temporary working memory, holding the programs and data in use; its contents are lost when power goes off.
  4. 34CompilerProgramming Fundamentals, p. 11A compiler is a program that translates source code written in a programming language into a lower-level form, such as machine code, that a computer can run.
  5. 35InterpreterProgramming Fundamentals, p. 30An interpreter is a program that runs source code directly, step by step, instead of first translating the whole program into a separate executable file.
  6. 36ProcessOperating Systems, p. 23A process is a running instance of a program, with its own memory space, resources, and at least one thread of execution managed by the operating system.
  7. 37ThreadOperating Systems, p. 33A thread is the smallest unit of execution an operating system can schedule, running inside a process and sharing that process's memory with other threads.
  8. 38ParallelismProgramming Fundamentals, p. 42Parallelism is running several computations at literally the same time, on multiple CPU cores, GPUs or machines, so a large job finishes faster.
  9. 39Stack MemoryOperating Systems, p. 28Stack memory is where a thread keeps its functions' local variables and return addresses, growing with each call and shrinking automatically on return.
  10. 40Heap MemoryOperating Systems, p. 14Heap memory is the region for data a program allocates at runtime, whose size or lifetime isn't known in advance and can outlive the function that made it.
  11. 41Virtual MemoryOperating Systems, p. 37Virtual memory is an operating system technique that gives each process its own private address space and maps it to physical RAM or disk behind the scenes.
  12. 42Garbage CollectionProgramming Fundamentals, p. 23Garbage collection is automatic memory management in which the language runtime finds data a program can no longer use and frees that memory for reuse.

Along the way, compare

Pairs on this path that are easy to mix up, side by side.

More

Settings