Log in

View Full Version : Most asked coding interview patterns based on LeetCode discussion



charlesprabhu
03-13-2024, 03:08 AM
1. Topological Sorting: Used to find a linear ordering of vertices in a directed graph, commonly applied in dependency resolution and scheduling problems.

2. Two Pointers: Suitable for problems that require iterating through an array or list using two pointers to solve efficiently.

3. Sliding Window: Used for problems that involve finding the optimal subarray or substring within a given array or string.

4. Depth-First Search (DFS): Useful for traversing graphs or trees in a depth-first manner, often used to solve problems involving paths or connected components.

5. Breadth-First Search (BFS): Effective for exploring graph or tree structures level by level, commonly used in shortest path and connectivity problems.

6. Hashing: Utilized to achieve constant-time lookups and efficiently store and retrieve key-value pairs, often used in problems involving frequency counting or set operations.