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
What is the salary of Dell graduate Intern?
What is a hybrid job?
Which language is used for QA?
What do @classmethod and @staticmethod mean in Python, and how are they different?
What is the best coding method?
Why is Twilio calling me?
Related Courses
New
Grokking the AI System Design Interview course cover
Grokking the AI System Design Interview
Learn to design AI systems the way interviewers expect: classic ML products, LLM and RAG architectures, and agentic systems, all through the lens of the system design interview.
4.8
(1,192 learners)
Discounted price for Your Region

$123

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

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