What are the common algorithms for LeetCode?

LeetCode challenges cover a wide range of algorithmic concepts. Preparing for these challenges often involves familiarizing yourself with some common algorithms. Here's a list of key algorithms often encountered in LeetCode problems:

1. Sorting Algorithms

  • Bubble Sort
  • Merge Sort
  • Quick Sort
  • Heap Sort
  • Insertion Sort
  • Radix Sort

2. Search Algorithms

  • Binary Search
  • Depth-First Search (DFS)
  • Breadth-First Search (BFS)
  • Linear Search

3. Dynamic Programming

  • Memoization
  • Tabulation
  • Divide and Conquer

4. Recursion

  • Basic Recursion
  • Backtracking (e.g., solving puzzles like Sudoku, N-Queens problem)

5. Graph Algorithms

  • Dijkstra's Algorithm (Shortest Path)
  • Bellman-Ford Algorithm
  • Floyd-Warshall Algorithm
  • Topological Sort
  • Kruskal’s and Prim’s Algorithms (Minimum Spanning Tree)

6. Tree Algorithms

  • Tree Traversal (Inorder, Preorder, Postorder)
  • Binary Search Trees
  • AVL Trees
  • Segment Trees
  • Fenwick Trees or Binary Indexed Trees

7. Greedy Algorithms

  • Activity Selection
  • Huffman Coding
  • Prim’s and Kruskal’s Algorithms

8. String Manipulation Algorithms

  • String Matching and Parsing
  • KMP Algorithm (Knuth Morris Pratt)
  • Rabin-Karp Algorithm
  • Trie (Prefix Tree) Implementation

9. Bit Manipulation Techniques

  • Basic Bit Operations
  • Bitmasking Techniques
  • Brian Kernighan’s Algorithm

10. Data Structures

  • Arrays and Linked Lists
  • Stacks and Queues
  • Hash Tables
  • Heaps

Conclusion

This list is not exhaustive but covers many of the fundamental algorithms that are often used to solve problems on LeetCode. A solid understanding of these algorithms, along with strong problem-solving skills, will be immensely beneficial in tackling LeetCode challenges effectively.

TAGS
Data Structures and Algorithms
Dynamic Programming Patterns
Coding Interview Questions
Coding Interview
Coding Patterns
CONTRIBUTOR
Arslan Ahmad
Arslan Ahmad
ex-FAANG engineering manager and author or Grokking series.
-

GET YOUR FREE

Coding Questions Catalog

Design Gurus Newsletter - Latest from our Blog
Boost your coding skills with our essential coding questions catalog.
Take a step towards a better tech career now!
Explore Answers
Which programming language is best for getting a job in Amazon?
What is the salary package of Adobe?
Why is Netflix so popular?
What is a tech interview?
What is the full time salary of Atlassian?
What are the 4 types of deadlock?
Related Courses
Grokking the Coding Interview: Patterns for Coding Questions course cover
Grokking the Coding Interview: Patterns for Coding Questions
The 24 essential patterns behind every coding interview question. Available in Java, Python, JavaScript, C++, C#, and Go. The most comprehensive coding interview course with 543 lessons. A smarter alternative to grinding LeetCode.
4.6
Discounted price for Your Region

$197

Grokking Modern AI Fundamentals course cover
Grokking Modern AI Fundamentals
Master the fundamentals of AI today to lead the tech revolution of tomorrow.
4.1
Discounted price for Your Region

$72

Grokking Data Structures & Algorithms for Coding Interviews course cover
Grokking Data Structures & Algorithms for Coding Interviews
Unlock Coding Interview Success: Dive Deep into Data Structures and Algorithms.
Discounted price for Your Region

$78

Design Gurus logo
One-Stop Portal For Tech Interviews.
Copyright © 2026 Design Gurus, LLC. All rights reserved.