Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save duongnvt2110/f76228155e3b7c968d1329bf9e8bc65e to your computer and use it in GitHub Desktop.
Save duongnvt2110/f76228155e3b7c968d1329bf9e8bc65e to your computer and use it in GitHub Desktop.
Data Structures and Algorithms: The Greatest Hits

Data Structures and Algorithms: The Greatest Hits

Relevant Chapters from CTCI

  • Arrays and Strings (1)
  • Linked Lists (2)
  • Stacks and Queues (3)
  • Trees and Graphs (4)
  • Bit Manipulation (5)
  • Math and Logic Puzzles (6)
  • Recursion and Dynamic Programming (8)
  • Sorting and Searching (1)
  • Moderate-Difficulty Questions (16)

Approach

  1. Flashcards for each implementation in JS
  2. Time/space complexity of each
  3. Three problems each

Data Structures

  • Hash Table
  • Linked Lists (Singly and Doubly Linked)
  • Stack
  • Queue
  • Heap
  • Binary Tree and Binary Search Tree
  • B-Tree
  • Tries
  • Graphs

Sorting Algorithms

  • Bubble Sort
  • Merge Sort
  • Quick Sort
  • Heap Sort

Search Algorithms

  • Binary Search
  • Depth-First Search (graph/tree)
  • Breadth-First Search (graph/tree)

Dynamic Programming

  • Memoization

Other

  • Bit Manipulation (by hand)
  • The Factory pattern
  • Recursion pattern (base case/recursive case)

Extra Credit (from Omri)

  • Djikstra's algorithm
  • Fast fourier transform
  • Minimax
  • Genetic algorithms
  • Page rank
  • Runner techniques in linked lists
  • For depth first search: post-order, pre-order, in-order
  • Knuth-Pratt or Boyer-Moore or other string matching algos
  • Raycasting
  • Stable roommates algorithm
  • Fisher-Yates shuffle

Extra Credit (System Design)

  • HTTP (at the protocol level)
  • Databases (indexes, query planning)
  • CDNs
  • Caching (LRU cache, memcached, redis)
  • Load balancers

Resources

Interview Tips

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment