0% found this document useful (0 votes)
3 views3 pages

Dsa Que Pattern

The document outlines various data structure and algorithm patterns commonly used in product-based companies, categorized into techniques such as Two Pointer, Sliding Window, Prefix Sum, Dynamic Programming, Greedy Algorithm, Binary Search, Hashing, Stack Based, Matrix Operations, and Divide & Conquer. Each category includes a list of specific problems or challenges that can be solved using the respective technique. This serves as a guide for understanding and applying these patterns in coding interviews and practical applications.

Uploaded by

durvashah4
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views3 pages

Dsa Que Pattern

The document outlines various data structure and algorithm patterns commonly used in product-based companies, categorized into techniques such as Two Pointer, Sliding Window, Prefix Sum, Dynamic Programming, Greedy Algorithm, Binary Search, Hashing, Stack Based, Matrix Operations, and Divide & Conquer. Each category includes a list of specific problems or challenges that can be solved using the respective technique. This serves as a guide for understanding and applying these patterns in coding interviews and practical applications.

Uploaded by

durvashah4
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

DSA Pattern Classification for Product-Based

Companies

Two Pointer Technique


1 Trapping Rain Water

2 Count Pairs with Given Sum

3 3Sum (Triplets with 0 Sum)

4 Find Triplet with Given Sum

5 Find Quadruplet with Given Sum

6 Rearrange Alternate Even & Odd

7 Find Peak Element

8 Product of Array Except Self

9 Convert Array to Zig-Zag

10 Cyclic Rotation

11 Move Negatives to Beginning

12 Leaders in Array

13 Container With Most Water

14 Sort Colors (Dutch National Flag)

Sliding Window (Fixed & Variable)


1 Maximum Sum Subarray of Size K (Fixed)

2 Minimum Length Subarray Sum > K (Variable)

3 Count Subarrays with Sum = K

4 Subarrays Divisible by K

5 Longest Substring with Unique Characters

6 Longest Substring with K Distinct Characters

7 Minimum Size Subarray >= Target

8 Subarray Product Less Than K

Prefix Sum + HashMap


1 Subarray with 0 Sum

2 Subarray with Equal Even & Odd

3 Count Subarray Sum = K

4 Subarrays Divisible by K

5 Longest Subarray with Equal 0s and 1s

6 Count Subarrays with XOR


Dynamic Programming
1 Maximum Product Subarray

2 Maximum Circular Subarray Sum

3 Maximum Sum Increasing Subsequence

4 Maximum Length Bitonic Subarray

5 Minimum Jumps to Reach End

6 Equal Sum Partition

7 Longest Increasing Path in Matrix

Greedy Algorithm
1 Majority Element (Boyer-Moore)

2 Jump Game I

3 Jump Game II

4 Gas Station Problem

5 Candy Distribution

6 Partition Labels

7 Minimum Platforms

Binary Search / Binary Search on Answer


1 Search in Rotated Sorted Array

2 Find Minimum in Rotated Sorted Array

3 Peak Element

4 Allocate Minimum Pages

5 Aggressive Cows

6 Split Array to Minimize Largest Sum

7 Median of Two Sorted Arrays

Hashing / Set Based


1 Element Occurring Once

2 Missing Number

3 Duplicate Elements

4 Longest Consecutive Sequence

5 Missing and Repeating Number

6 Subset Check

7 Group Anagrams
8 Distinct Elements in Window

Stack Based
1 Trapping Rain Water (Stack Version)

2 Sort Array Using Stack

3 Maximum Frequency Stack

4 Next Greater Element Variants

Matrix / 2D Array
1 Rotate Matrix

2 Spiral Matrix Traversal

3 Sudoku Operations

4 Word Search

5 Number of Islands

6 Set Matrix Zeroes

7 Search in 2D Matrix

Divide & Conquer / Merge Sort


1 Count Inversions
2 Count Smaller Elements on Right
3 Median of Arrays

You might also like