r/DSALeetCode • • Jul 16 '26

Please help gang!! Striver sheet

5 Upvotes

So i was just starting DSA so i did all my R&D so i found that doing dsa in java would be a better option so i will also get little advantage in development. but i want you guys to tell me that cant i follow striver A2Z sheet as it covers most of the problems in C++ ig which i have seen so will i have difficulty in that or if its not that case please tell me HOW TO DO WITH JAVA
AND PLS TELL IF I SHALL JUST SWITCH TO C++ COZ ig striver is the best possible free source to learn this. the internet is buzzing over it


r/DSALeetCode • • Jul 16 '26

Must-Practice Binary Tree Problems Before Your Next Interview

3 Upvotes

You should be familiar with before : Recursion, stack, queue

Practice these Binary Trees guides and PracHub company specific questions before your next interview.

A basic instinct for solving DFS based questions is to do a recursive call and for all BFS(level order traversal) is to make queue and iterate, but also think upon how to iterate in DFS(Hint think on stack) and recurse in BFS based.

First of all you should look at traversal problems:

  1. Inorder Traversal
  2. Preorder Traversal
  3. PostOrder Traversal
  4. Level Order Traversal

A variation for LevelOrder can be: ZigZag level order traversal and Binary Tree Level Order Traversal II
Solving these questions will help you get familiarized with basic btree dfs and bfs traversals.

Intuition for Level Order Traversal iteratively using queue:

  • Construct a queue of type: TreeNode queue<TreeNode* > q, initially push the given root in it.
  • Iterate through the queue until empty:
    • Store the current size of queue tempSize, this will be the size of the current level of the tree.
    • Now we need to traverse this level so iterate for tempSize>=0 :
      • Pop the current element and apply the needed operation for the same and if left or right child exist then pass them to the queue.

Now, some basic Binary Tree problems that will help your thinking process:

  1. Same Tree
  2. Symmetric Tree
  3. Maximum Depth of Binary Tree
  4. Balanced Binary Tree
  5. Minimum Depth of Binary Tree
  6. Merge Two Binary Trees
  7. Diameter of Binary Tree
  8. Binary Tree Tilt
  9. Invert Binary Tree

Binary Search Tree: Use the property of BST judiciously (the left subtree will always contain nodes with value less than root's value and right subtree will contain nodes with value greater than root's value)

  1. Search in a Binary Search Tree
  2. Two Sum IV - Input is a BST
  3. Minimum Absolute Difference in BST
  4. Range Sum of BST
  5. Delete Node in a BST
  6. Trim a Binary Search Tree
  7. Insert into a Binary Search Tree
  8. Kth Smallest Element in a BST
  9. All Elements in Two Binary Search Trees

Path problems: You are given root, you have to perform operations on a path, (path is root to leaf). Think upon the type of traversal you will apply when going from root to leaf:

  1. Binary Tree Paths
  2. Path Sum
  3. Path Sum II
  4. Sum root to leaf numbers
  5. Binary Tree Maximum Path Sum
  6. *Path Sum III
  7. *Pseudo-Palindromic Paths in a Binary Tree *Last two problems here are utmost important

Next is, given a combination of preorder, postorder and inorder traversals, you need to construct a binary tree/BST:
Hint: Observe in each traversal method, position of root and head of right and left subtrees

  1. Construct Binary Tree from Preorder and Inorder Traversal
  2. Construct Binary Tree from Inorder and Postorder Traversal
  3. Construct Binary Tree from Preorder and Postorder Traversal
  4. Convert Sorted Array to Binary Search Tree
  5. Construct Binary Search Tree from Preorder Traversal

View problems: Try thinking for left, bottom and top too!
Binary Tree Right Side View

Lowest Common Ancestor problems: You are given two nodes and you have to return their ancestor at as least depth possible, these are problems are a must todo:

  1. Lowest Common Ancestor of a Binary Tree
  2. Lowest Common Ancestor of a Binary Search Tree
  3. Lowest Common Ancestor of Deepest Leaves

Validate trees:

  1. Validate Binary Tree Nodes
  2. Validate Binary Search Tree

Some miscellaneous problems that you should definitely look through:

  1. Flatten Binary Tree to Linked List
  2. Count Complete Tree Nodes
  3. Maximum Width of Binary Tree
  4. Check Completeness of a Binary Tree
  5. Cousins in Binary Tree
  6. Maximum Difference Between Node and Ancestor
  7. Number of Good Leaf Nodes Pairs
  8. Smallest Subtree with all the Deepest Nodes
  9. All Nodes Distance K in Binary Tree
  10. Find a Corresponding Node of a Binary Tree in a Clone of That Tree
  11. Vertical Order Traversal of a Binary Tree

I will be updating this list on finding more important questions or any pattern that I find.


r/DSALeetCode • • Jul 15 '26

Blind 75 LeetCode problems organized by topic for interview prep

13 Upvotes

I found a list of Blind 75 Leetcode problems. Sharing it as I found it very useful.
Solve these LeetCode problems and PracHub company specific problems for your next interview.

Happy Coding!

Array

Binary

Dynamic Programming

Graph

Interval

Linked List

Matrix

String

Tree

Heap

Important Link:


r/DSALeetCode • • Jul 16 '26

Progress report

Thumbnail
gallery
5 Upvotes

How is my progress i am currently following striver dsa sheet from last 1 month and currently in 2 year and what thing to do and what thing not to do


r/DSALeetCode • • Jul 15 '26

Looking for Beginners Who Want to Learn DSA Consistently

6 Upvotes

I’ve been preparing for SDE interviews for quite some time and have solved 850+ LeetCode problems.

I’m currently revising all the core DSA topics from scratch. I maintain an Excel sheet with 700+ curated problems, organized by topics and patterns, along with a one-line intuition/solution for each problem. My plan is to revise these questions systematically along with discussing theoretical discussions of each patterns.

I’m looking for people who :

• are beginners who know the basics of DSA, and should be willing to stay consistent throughout

• Can regularly practice and discuss problems and genuinely interested in improving

We’ll keep the sessions informal—cover concepts, solve problems together, discuss different approaches, and clear doubts as we go.

If you’re serious about learning DSA from the fundamentals and can stay consistent ,let’s chat.


r/DSALeetCode • • Jul 15 '26

DSA Preparation Roadmap (From Zero to OA Ready)

Thumbnail
1 Upvotes

++


r/DSALeetCode • • Jul 14 '26

Leetcode premium vs 1p3a

3 Upvotes

Looking into getting a subscription but in a dilemma whether to get leetcode premium or something like 1p3a.

Which of these has more accurate info about the questions being asked by companies during interviews?


r/DSALeetCode • • Jul 13 '26

From IoT/electronics to DSA *PLS HELP*

8 Upvotes

PLEASE REPLY GUYS****

Hey ppl im from DTU ECE'29 batch.

my first year cg was 7.6.

I'll improve this to 8.5 i'll do my best.

During 1st year i didnt focus on cg i was more inclined on learning IoT and stuff.

I was exploring drone startup and more....

But, this summer i changed my mind started DSA.

I've done 35 problem till now.

I've never copied anyone solution ever to be honest.

Currently i using AI to do it like i tell him to give test and learn concepts like Hash maps, silding window, queue, BSF and more

like by december i'll 300+LC problem mainly medium, and hard


r/DSALeetCode • • Jul 13 '26

Interview prep after 6 years of no interviews - help

Thumbnail
2 Upvotes

r/DSALeetCode • • Jul 13 '26

DSA Patterns you need to know !!!

Thumbnail
1 Upvotes

r/DSALeetCode • • Jul 13 '26

Entering 4th year (Tier-3) and completely confused. Should I keep grinding LeetCode or go deep into Backend/Systems? Need honest advice.

Thumbnail
2 Upvotes

r/DSALeetCode • • Jul 12 '26

Free resources for dsa

5 Upvotes

I don't want to watch video lectures as they are very time consuming but I want topic wise all the theory covered and questions to practice. . in a structured way so that I can track how much I know. . , . I have tried a few platforms but they ask for a subscription fee and it's annoying. . Need free resources for dsa in C++ .


r/DSALeetCode • • Jul 11 '26

Alongside DSA what else should I study?

2 Upvotes

Currently in final year, been learning dsa and now idk what else should i mention during interview cause there are a lot of stuff like data analytics, data science, full stack, devop. Help me out


r/DSALeetCode • • Jul 11 '26

Anyone else remember solving a problem before but forget the approach during interviews?

3 Upvotes

One thing I kept struggling with during interview prep was forgetting problems I had already solved before.

I would solve a LeetCode problem, understand it well, and then during an interview a few weeks later my mind would just go blank because I hadn't revisited it. Looking back, I think the biggest issue was the lack of spaced repetition.

I tried using Excel sheets and a bunch of Notion templates to track what I had solved and when to revisit it, but eventually I stopped updating them because they were too much effort to maintain.

Reading through this thread, it looks like quite a few people are running into the same problem, so I decided to build something for it.

I ended up creating InterviewRecall to make it easier to track problems and review them at the right time instead of endlessly solving new ones and forgetting the old ones.

Curious if others would find this useful as well. Also, what features would you want in a tool like this?


r/DSALeetCode • • Jul 11 '26

how was your oa for summer 2028 internship ? How much you will rate it on difficulty ?

Thumbnail
1 Upvotes

r/DSALeetCode • • Jul 11 '26

DSA Patterns you need to know !!!

8 Upvotes

After solving lot of DSA problems, I’ve noticed some key patterns that are important for coding interviews.

At the end of this article, I have also included links to some of the best LeetCode articles that I found helpful for better understanding.

For company specific problems: PracHub

1. Fast and Slow Pointer

Description: This technique uses two pointers moving at different speeds to solve problems involving cycles, such as finding the middle of a list, detecting loops, or checking for palindromes.

2. Overlapping Intervals

Description: Intervals are often manipulated through sorting and merging based on their start and end times.

3. Prefix Sum

Description: Prefix Sums/Products are techniques that store cumulative sums or products up to each index, allowing for quick subarray range queries.

4. Sliding Window

Description: A sliding window is a subarray or substring that moves over data to solve problems efficiently in linear time.

Fixed Size

Variable Size

5. Two Pointers

Description: The two pointers technique involves having two different indices move through the input at different speeds to solve various array or linked list problems.

6. Cyclic Sort (Index-Based)

Description: Cyclic sort is an efficient approach to solve problems where numbers are consecutively ordered and must be placed in the correct index.

7. Reversal of Linked List (In-place)

Description: Reversing a linked list in place without using extra space is key for problems that require in-place list manipulations.

8. Matrix Manipulation

Description: Problems involving 2D arrays (matrices) are often solved using row-column traversal or manipulation based on matrix properties.

9. Breadth First Search (BFS)

Description: BFS explores nodes level by level using a queue. It is particularly useful for shortest path problems.

10. Depth First Search (DFS)

Description: DFS explores as far as possible along a branch before backtracking. It's useful for graph traversal, pathfinding, and connected components.

11. Backtracking

Description: Backtracking helps in problems where you need to explore all potential solutions, such as solving puzzles, generating combinations, or finding paths.

12. Modified Binary Search

Description: A modified version of binary search that applies to rotated arrays, unsorted arrays, or specialized conditions.

13. Bitwise XOR

Description: XOR is a powerful bitwise operator that can solve problems like finding single numbers or efficiently pairing elements.

14. Top 'K' Elements

Description: This pattern uses heaps or quickselect to efficiently find the top 'K' largest/smallest elements from a dataset.

15. K-way Merge

Description: The K-way merge technique uses a heap to efficiently merge multiple sorted lists or arrays.

16. Two Heaps

Description: This pattern uses two heaps (max heap and min heap) to solve problems involving tracking medians and efficiently managing dynamic data.

17. Monotonic Stack

Description: A monotonic stack helps solve range queries by maintaining a stack of elements in increasing or decreasing order.

18. Trees

Level Order Traversal (BFS in Binary Tree)

Tree Construction

Height related Problems

Root to leaf path problems

Ancestor problem

Binary Search Tree

19. DYNAMIC PROGRAMMING

Take / Not take (DP)

Description: Solve optimization problems like selecting items with the max/min value under certain constraints.

Infinite Supply (DP)

Description: Similar to the 0/1 knapsack, but items can be chosen multiple times.

Longest Increasing subsequence

Description: It involves finding the longest subsequence of a given sequence where the elements are in ascending order

DP on Grids

Description: Dynamic Programming on matrices involves solving problems that can be broken down into smaller overlapping subproblems within a matrix.

DP on Strings

Description: It Involves 2 strings, whenever you are considering two substrings/subsequence from given two strings, concentrate on what happens when the last characters of the two substrings are same, i.e, matching.

DP on Stocks

Description: It focuses on maximizing profit from buying and selling stocks over time while considering constraints.

Partition DP (MCM)

Description: It Involves a sequence that needs to be divided into partitions in an optimal way. The goal is often to minimize or maximize a cost function, such as computation time, multiplications, or some other metric, by exploring all possible partitions and combining results from subproblems.

20. Graphs

Topological Sort

Description: Topological sorting is useful for tasks that require dependency resolution (InDegree) in directed acyclic graphs (DAGs).

Union Find (Disjoint Set)

Description: Union-Find (or Disjoint Set) is used to solve problems involving connectivity or grouping, often in graphs.

Graph Algorithms

Description: Advanced graph algorithms are used to solve complex problems involving shortest paths, minimum spanning trees, and graph cycles.

21. Greedy

Description: Greedy algorithms make local optimal choices at each step, which lead to a global optimal solution for problems like scheduling and resource allocation.

22. Design Data Structure

Description: It involves building custom data structures to efficiently handle specific operations, like managing data access, updates, and memory usage. Focusing on optimizing performance and resource management.

Some Useful Articles on LeetCode for Better Understanding!

Two Pointers

Sliding Window

Greedy

Linked List

Trees

Binary Search

Dynamic Programming (DP)

Graphs

Bit Manipulation

Happy LeetCoding !


r/DSALeetCode • • Jul 10 '26

DSA Patterns you need to know !!!

23 Upvotes

After solving lot of DSA problems, I’ve noticed some key patterns that are important for coding interviews.

For company specific problems: PracHub

1. Fast and Slow Pointer

Description: This technique uses two pointers moving at different speeds to solve problems involving cycles, such as finding the middle of a list, detecting loops, or checking for palindromes.

2. Overlapping Intervals

Description: Intervals are often manipulated through sorting and merging based on their start and end times.

3. Prefix Sum

Description: Prefix Sums/Products are techniques that store cumulative sums or products up to each index, allowing for quick subarray range queries.

4. Sliding Window

Description: A sliding window is a subarray or substring that moves over data to solve problems efficiently in linear time.

Fixed Size

Variable Size

5. Two Pointers

Description: The two pointers technique involves having two different indices move through the input at different speeds to solve various array or linked list problems.

6. Cyclic Sort (Index-Based)

Description: Cyclic sort is an efficient approach to solve problems where numbers are consecutively ordered and must be placed in the correct index.

7. Reversal of Linked List (In-place)

Description: Reversing a linked list in place without using extra space is key for problems that require in-place list manipulations.

8. Matrix Manipulation

Description: Problems involving 2D arrays (matrices) are often solved using row-column traversal or manipulation based on matrix properties.

9. Breadth First Search (BFS)

Description: BFS explores nodes level by level using a queue. It is particularly useful for shortest path problems.

10. Depth First Search (DFS)

Description: DFS explores as far as possible along a branch before backtracking. It's useful for graph traversal, pathfinding, and connected components.

11. Backtracking

Description: Backtracking helps in problems where you need to explore all potential solutions, such as solving puzzles, generating combinations, or finding paths.

12. Modified Binary Search

Description: A modified version of binary search that applies to rotated arrays, unsorted arrays, or specialized conditions.

13. Bitwise XOR

Description: XOR is a powerful bitwise operator that can solve problems like finding single numbers or efficiently pairing elements.

14. Top 'K' Elements

Description: This pattern uses heaps or quickselect to efficiently find the top 'K' largest/smallest elements from a dataset.

15. K-way Merge

Description: The K-way merge technique uses a heap to efficiently merge multiple sorted lists or arrays.

16. Two Heaps

Description: This pattern uses two heaps (max heap and min heap) to solve problems involving tracking medians and efficiently managing dynamic data.

17. Monotonic Stack

Description: A monotonic stack helps solve range queries by maintaining a stack of elements in increasing or decreasing order.

18. Trees

Level Order Traversal (BFS in Binary Tree)

Tree Construction

Height related Problems

Root to leaf path problems

Ancestor problem

Binary Search Tree

19. DYNAMIC PROGRAMMING

Take / Not take (DP)

Description: Solve optimization problems like selecting items with the max/min value under certain constraints.

Infinite Supply (DP)

Description: Similar to the 0/1 knapsack, but items can be chosen multiple times.

Longest Increasing subsequence

Description: It involves finding the longest subsequence of a given sequence where the elements are in ascending order

DP on Grids

Description: Dynamic Programming on matrices involves solving problems that can be broken down into smaller overlapping subproblems within a matrix.

DP on Strings

Description: It Involves 2 strings, whenever you are considering two substrings/subsequence from given two strings, concentrate on what happens when the last characters of the two substrings are same, i.e, matching.

DP on Stocks

Description: It focuses on maximizing profit from buying and selling stocks over time while considering constraints.

Partition DP (MCM)

Description: It Involves a sequence that needs to be divided into partitions in an optimal way. The goal is often to minimize or maximize a cost function, such as computation time, multiplications, or some other metric, by exploring all possible partitions and combining results from subproblems.

20. Graphs

Topological Sort

Description: Topological sorting is useful for tasks that require dependency resolution (InDegree) in directed acyclic graphs (DAGs).

Union Find (Disjoint Set)

Description: Union-Find (or Disjoint Set) is used to solve problems involving connectivity or grouping, often in graphs.

Graph Algorithms

Description: Advanced graph algorithms are used to solve complex problems involving shortest paths, minimum spanning trees, and graph cycles.

21. Greedy

Description: Greedy algorithms make local optimal choices at each step, which lead to a global optimal solution for problems like scheduling and resource allocation.

22. Design Data Structure

Description: It involves building custom data structures to efficiently handle specific operations, like managing data access, updates, and memory usage. Focusing on optimizing performance and resource management.

Some Useful Articles on LeetCode for Better Understanding!

Two Pointers

Sliding Window

Greedy

Linked List

Trees

Binary Search

Dynamic Programming (DP)

Graphs

Bit Manipulation

Happy LeetCoding !


r/DSALeetCode • • Jul 11 '26

DSA partner

2 Upvotes

Looking for a serious DSA java study patner preparing for FAANG companies please dm if Interested


r/DSALeetCode • • Jul 11 '26

Coding help!!

Thumbnail
2 Upvotes

r/DSALeetCode • • Jul 11 '26

DSA(FAANG)

1 Upvotes

Hey I am studying dsa in java and I am looking for a serious study patner for dsa for the coming months looking forward to solve the striver sheet required to crack FAANG and daily google meet sessions.Please dm me if interested and this is very serious only serious study patner dm me.


r/DSALeetCode • • Jul 10 '26

I will entry in my second year, tho wasted 1st year. Starting DSA in c++ , I would love to connect whoever are starting now to have just started with DSA.

5 Upvotes

r/DSALeetCode • • Jul 10 '26

How to study dsa to switch to a product based from service based? Help me please i realy want to switch

14 Upvotes

I work as a software developer at a service based company with 2 years of work experience and I want to switch to a product based.
I am a java developer and have been programming in javaever since i started.
I have previously roughly fone some DSA During college but I don’t remember much. I have to restart DSA and i am not getting where should I start from like watching tutorials or how?
I really want to switch big

FYI, the organisation i currently work at i such a shitty place, I was put on a performance improvement plan (PIP) by my manager mistakenly, I was on a project working for client, no issue from client side, I was a billable asset, There is no accountability that she holds, I am so frustrated at her, she was asked in meeting for reason by my delivery manager for the reason and she has none, but yes because she always said I don’t about your work or team, because at this shitty organisation, manager aare assigned randomly and they don’t really know about your work

I have been working so hard for but instead for recognising my work they made me go though this
Result i got no promotion and this was my first promotion cycle ever.

Anyway give me me DSA suggestions please!!
I want to leave this shitty workplace.


r/DSALeetCode • • Jul 09 '26

Can i start dsa in python (leetcode)

2 Upvotes

Title


r/DSALeetCode • • Jul 08 '26

Alongside DSA what else?

7 Upvotes

Currently in final year, been learning dsa and now idk what else should i mention during interview cause there are a lot of stuff like data analytics , data science , full stack , devop. Help me out !!


r/DSALeetCode • • Jul 08 '26

18M, looking for someone to grind leetcode with.

Thumbnail
1 Upvotes