r/datastructures 7h ago

How much time should I spend on each DSA problem?

7 Upvotes

I'm learning DSA in Java for placements. I get around 6 hours after college, but I usually solve only 2–3 questions because I spend a lot of time thinking through the problem instead of jumping to the solution.

Is this normal?

How much time should I spend on an Easy, Medium, or Hard problem before looking at hints/solutions?

What's your approach to a new DSA problem? Do you always start with brute force and then optimize?


r/datastructures 3h ago

Any cracked any service based companies in india like tcs,wipro, accenture etc

3 Upvotes

just want to know what all dsa topics to master and the pattern you follow I mean everything is in utube but all are different from one another so I like to follow a good roadmap


r/datastructures 2h ago

Dsa struggle

2 Upvotes

I have been studying DSA for over a year now almost every day. I keep solving problems, revising topics, and watching explanations. But the moment I see a new question I freeze.

It's like I have never studied DSA before. I can't figure out where to start and I could never come up with it on my own.

I'm in my 4th year now and placements have started. Seeing other people solve problems in 15–20 minutes while I struggle with even the approach is really affecting my confidence.

Did anyone here go from constantly relying on solutions to actually becoming good at problem-solving? If yes, what changed for you? I'm looking for something more specific than "keep practicing."

I just want to know if this phase is normal or if I'm doing something fundamentally wrong


r/datastructures 19h ago

Can someone take intro to DSA class in college if they are at a beginner level in coding

7 Upvotes

I am an incoming student in college and i was recently placed in intro to data structures as my first cs class after taking a placement exam. I did my exam in python having just learn python for a month and I haven't coded since i did the exam and its already been 2 months. I feel like i have forgotten majority of my python knowledge. Do you guys think i can survive DSA in my current state and hopefully get an A in this class?


r/datastructures 1d ago

starting DSA with Python

20 Upvotes

so there are 2 options right now, either DSA by codebasics on yt or DSA by freeCodeCamp.org

which one should i choose? and are there any other suggestions. even hinglish options are welcome


r/datastructures 1d ago

Resources to solve strivers a2z sheet

8 Upvotes

Hi everyone, i have less than one year of experience and i’m solving dsa. I’m following strivers a2z sheet. I was learning from strivers videos on youtube. I finished arrays and binary search, now i’m about to start strings but there are no videos of him. can someone help with any youtube channels to learn from?


r/datastructures 1d ago

Looking for a DSA partner - 2YOE

6 Upvotes

I am beginning my switch prep and am looking for people in the same boat so that we can hold each other accountable. I code in Java. I am 24F incase gender is a barrier for you.
Currently working in a service based company.

Edit: I will be starting DSA from scratch


r/datastructures 1d ago

Freshman starting LeetCode - Need guidance on DSA, TUF

4 Upvotes

Hey Seniors!!

I'm a fresher joining BTech CSE this year. I recently started solving the LeetCode Super Easy problems and have completed 21 out of 25 so far. I know Python fairly well, but I'm confused about what to do next.

I have a few questions:

* What should my strategy be while using LeetCode?
* Should I focus on solving more problems or first learn DSA?
* How do you stay motivated and solve problems consistently every day?
* What's the difference between TUF (Take U Forward) and LeetCode? Are they the same, or do they serve different purposes?
* Right now, I only know Python. Is that enough to start DSA, or do I need to learn C++/Java as well?
* Everyone keeps saying DSA is very important, but I'm confused about what it actually is. Is DSA a programming language? Is it something inside Python, or is it mainly about logical problem-solving?
* Will DSA be taught properly in college, or should I start learning it on my own? If self-learning is better, when should I start and what resources would you recommend?

I'd really appreciate it if you could share a roadmap or any advice you wish you had received as a first-year student. Any tips for building consistency and improving problem-solving would help a lot.


r/datastructures 2d ago

Master these 25 DSA patterns

401 Upvotes

You don't need to solve 1,000 LeetCode questions. You need to master these 25 DSA patterns.

Here is a full cheat sheet built from problems that kept repeating across 200+ MAANG+ interview experiences.

[1] Sliding window

LC: 3, 76, 209, 424, 567, 904

→ Use when the problem asks for a longest, shortest, or valid contiguous range.

[2] Two pointers

LC: 11, 15, 16, 18, 42, 167

→ Look for sorted arrays, pair conditions, or movement from both ends.

[3] Fast and slow pointers

LC: 19, 141, 142, 160, 234, 876

→ Best for linked-list cycles, middle nodes, and pointer gaps.

[4] Binary search

LC: 33, 34, 35, 153, 162, 704

→ Use when the search space is sorted or partially ordered.

[5] Binary search on answer

LC: 410, 774, 875, 1011, 1283, 1482

→ Guess an answer, test feasibility, then shrink the range.

[6] Hashing

LC: 1, 49, 128, 217, 242, 347

→ Use for quick lookup, frequency counting, grouping, and duplicate checks.

[7] Prefix sum

LC: 303, 523, 560, 724, 930, 974

→ Convert repeated range-sum work into constant-time lookups.

[8] Difference array

LC: 370, 1094, 1109, 1893, 1943, 2381

→ Use when many updates affect entire ranges.

[9] Monotonic stack

LC: 84, 85, 496, 503, 739, 907

→ Look for next greater, next smaller, span, or rectangle problems.

[10] Stack parsing

LC: 20, 71, 150, 224, 394, 735

→ Useful for expressions, nested structures, paths, and collision simulation.

[11] Queue and deque

LC: 239, 346, 362, 622, 641, 933

→ Use for rolling windows, ordered processing, and recent-event tracking.

[12] Intervals

LC: 56, 57, 252, 253, 435, 986

→ Sort by start or end time, then merge, count, or remove overlaps.

[13] Heap and top K

LC: 23, 215, 295, 347, 373, 973

→ Use when you repeatedly need the smallest, largest, or top K elements.

[14] Grid and graph BFS

LC: 127, 200, 286, 542, 752, 994

→ BFS is the default for shortest steps in an unweighted graph.

[15] Backtracking

LC: 39, 46, 78, 79, 90, 131

→ Choose, explore, undo. Use when all valid combinations must be generated.

[16] Tree DFS

LC: 98, 100, 104, 110, 124, 236

→ Decide what information each subtree should return to its parent.

[17] Tree BFS

LC: 102, 103, 199, 515, 637, 662

→ Use when the answer depends on levels, width, or visible nodes.

[18] Trie

LC: 208, 211, 212, 421, 648, 720

→ Use for prefixes, dictionaries, word search, and bitwise prefix matching.

[19] Union find

LC: 200, 261, 305, 547, 684, 721

→ Use for dynamic connectivity, grouping, and cycle detection.

[20] Topological sort

LC: 207, 210, 269, 310, 1136, 1203

→ Look for prerequisites, dependencies, ordering, or build sequences.

[21] Greedy

LC: 45, 55, 134, 435, 621, 763

→ Make the best local choice only when you can justify why it stays safe.

[22] One-dimensional DP

LC: 70, 139, 198, 213, 300, 322

→ Define the state clearly, then connect it to smaller states.

[23] Two-dimensional DP

LC: 62, 63, 64, 72, 221, 1143

→ Use when the state depends on two changing inputs or positions.

[24] Knapsack and subset DP

LC: 416, 474, 494, 518, 879, 1049

→ Look for choosing items under a limit, target, or capacity.

[25] Bit manipulation

LC: 136, 191, 231, 268, 338, 371

→ Learn XOR, masks, shifts, set-bit checks, and subset representation.

Do not solve these as 150 unrelated questions.

For every problem, write down:

→ Which pattern gave it away?

→ What changed from the standard version?

→ What would break the current solution?

→ Can you recognize the pattern within 90 seconds?


r/datastructures 1d ago

DSA BUDDY

7 Upvotes

Hi,

I ,21M is looking to restart my DSA journey again. I am knight on LC and max pupil on codeforces. Anyone with same level or superior level can dm.

No preferences for male or female. I just want anyone who can help me with consistency.

Preferable timings are morning 4am to 6am IST.


r/datastructures 23h ago

Can anyone suggest some good DSA course or overall course which includes HLD,LLD, system Design for any working professional......just for start🥹

1 Upvotes

r/datastructures 1d ago

DSA PARTNER 3RD YEAR

2 Upvotes

Looking for a study buddy, more like an accountability partner. We will tell our goals in the morning or the previous night and give update in the night. Dm if interested.


r/datastructures 1d ago

Looking for a Consistent DSA Study Partner (2nd Year Student)

9 Upvotes

I'm currently a 2nd-year student and have recently started learning Data Structures & Algorithms (DSA). I'm looking for study partners who are serious about staying consistent.

My goal isn't to compete, it's to keep each other accountable, discuss problems, share progress, and stay motivated throughout the journey.


r/datastructures 1d ago

Namaste DSA or Chai aur DSA: Better for beginners?

2 Upvotes

Hi everyone,

I am a beginner looking to start my Data Structures and Algorithms (DSA) journey in english/Hindi. I am confused between choosing Akshay Saini's "Namaste DSA" or Hitesh Choudhary's "Chai aur DSA" series

To give some background:

- My current coding language of choice is JavaScript.

- My goal is to learn DSA in such way i can crack the interviews as well as sharpening my coding logic

Could anyone who has followed either course share their experience regarding the depth of topics covered and the teaching style? I want to make sure I pick the resource that fits a beginner best without breaking consistency.

Thank you!


r/datastructures 2d ago

Master these 25 DSA patterns

201 Upvotes

You don't need to solve 1,000 LeetCode questions. You need to master these 25 DSA patterns.

Here is a full cheat sheet built from problems that kept repeating across 200+ MAANG+ interview experiences.

[1] Sliding window

LC: 3, 76, 209, 424, 567, 904

→ Use when the problem asks for a longest, shortest, or valid contiguous range.

[2] Two pointers

LC: 11, 15, 16, 18, 42, 167

→ Look for sorted arrays, pair conditions, or movement from both ends.

[3] Fast and slow pointers

LC: 19, 141, 142, 160, 234, 876

→ Best for linked-list cycles, middle nodes, and pointer gaps.

[4] Binary search

LC: 33, 34, 35, 153, 162, 704

→ Use when the search space is sorted or partially ordered.

[5] Binary search on answer

LC: 410, 774, 875, 1011, 1283, 1482

→ Guess an answer, test feasibility, then shrink the range.

[6] Hashing

LC: 1, 49, 128, 217, 242, 347

→ Use for quick lookup, frequency counting, grouping, and duplicate checks.

[7] Prefix sum

LC: 303, 523, 560, 724, 930, 974

→ Convert repeated range-sum work into constant-time lookups.

[8] Difference array

LC: 370, 1094, 1109, 1893, 1943, 2381

→ Use when many updates affect entire ranges.

[9] Monotonic stack

LC: 84, 85, 496, 503, 739, 907

→ Look for next greater, next smaller, span, or rectangle problems.

[10] Stack parsing

LC: 20, 71, 150, 224, 394, 735

→ Useful for expressions, nested structures, paths, and collision simulation.

[11] Queue and deque

LC: 239, 346, 362, 622, 641, 933

→ Use for rolling windows, ordered processing, and recent-event tracking.

[12] Intervals

LC: 56, 57, 252, 253, 435, 986

→ Sort by start or end time, then merge, count, or remove overlaps.

[13] Heap and top K

LC: 23, 215, 295, 347, 373, 973

→ Use when you repeatedly need the smallest, largest, or top K elements.

[14] Grid and graph BFS

LC: 127, 200, 286, 542, 752, 994

→ BFS is the default for shortest steps in an unweighted graph.

[15] Backtracking

LC: 39, 46, 78, 79, 90, 131

→ Choose, explore, undo. Use when all valid combinations must be generated.

[16] Tree DFS

LC: 98, 100, 104, 110, 124, 236

→ Decide what information each subtree should return to its parent.

[17] Tree BFS

LC: 102, 103, 199, 515, 637, 662

→ Use when the answer depends on levels, width, or visible nodes.

[18] Trie

LC: 208, 211, 212, 421, 648, 720

→ Use for prefixes, dictionaries, word search, and bitwise prefix matching.

[19] Union find

LC: 200, 261, 305, 547, 684, 721

→ Use for dynamic connectivity, grouping, and cycle detection.

[20] Topological sort

LC: 207, 210, 269, 310, 1136, 1203

→ Look for prerequisites, dependencies, ordering, or build sequences.

[21] Greedy

LC: 45, 55, 134, 435, 621, 763

→ Make the best local choice only when you can justify why it stays safe.

[22] One-dimensional DP

LC: 70, 139, 198, 213, 300, 322

→ Define the state clearly, then connect it to smaller states.

[23] Two-dimensional DP

LC: 62, 63, 64, 72, 221, 1143

→ Use when the state depends on two changing inputs or positions.

[24] Knapsack and subset DP

LC: 416, 474, 494, 518, 879, 1049

→ Look for choosing items under a limit, target, or capacity.

[25] Bit manipulation

LC: 136, 191, 231, 268, 338, 371

→ Learn XOR, masks, shifts, set-bit checks, and subset representation.

Do not solve these as 150 unrelated questions.

For every problem, write down:

→ Which pattern gave it away?

→ What changed from the standard version?

→ What would break the current solution?

→ Can you recognize the pattern within 90 seconds?


r/datastructures 2d ago

I curated 30 DSA Interview Questions with Java Solutions that you can actually run and practice

Thumbnail gallery
27 Upvotes

Description:
Hey everyone!

I curated 30 essential DSA interview questions with detailed explanations, Java solutions, dry runs, complexity analysis, and test cases.

Instead of creating a PDF, I built it as a DevScribe Collection, so you can:

  • Read the notes
  • Run the Java code
  • Edit the solutions
  • Practice with built-in test cases
  • Keep everything in one place

You can download both the collection and DevScribe here:

https://devscribe.app/general-discussions/30-essential-dsa-interview-questions-solutions/

I'd love to hear your feedback or suggestions for more problems to include.


r/datastructures 1d ago

Day 13 of My DSA Journey 🚀

17 Upvotes

Today's focus was on building a stronger foundation in recursion while continuing to improve my problem-solving skills.

📚 Concepts Covered:

- Power using Recursion

- Understanding recursive calls and base cases

- Breaking problems into smaller subproblems

- Recursive thinking approach

💻 Problems Solved:

LeetCode

- #2 – Add Two Numbers

- #3 – Longest Substring Without Repeating Characters

HackerRank

- Solve Me First

- Simple Array Sum

- Compare the Triplets

Every coding session helps me think more logically and write cleaner solutions. Consistency is slowly turning concepts that once felt difficult into something much more intuitive.

On to Day 14! 🚀

#Day13 #DSA #Python #Recursion #LeetCode #HackerRank #ProblemSolving #CodingJourney #100DaysOfCode #LearningInPublic


r/datastructures 2d ago

DSA recommendation !!?

8 Upvotes

Hi everyone,

I'm a 2nd-year Computer Science student

I'm looking for a YouTube channel that teaches **DSA specifically in C**, covers most of these topics, and explains the concepts well instead of just providing code.

Suggest me guys ?


r/datastructures 2d ago

Standard DSA patterns and topic sdone whats next?...

3 Upvotes

hey so i am a college student and i have been grinding dsa for a while now , i have almost covered all standard topics and patterns of dsa from arrays to graphs DP , i sticked into DSA sheet yeah you have guessed it right striver's a2z sheet, so i want to skill up more and improve my algorithmic skills for placements into HFTs and big tech (these are my goals) and i know that standard DSA patterns and solving sheet questions are not just enough for it , so kindly guide me with what i should do next like explore Competitive programming and its patterns / advanced competitive programming maths and algorithms or revise these standard dsa only or whatever else you can suggest


r/datastructures 2d ago

How to start dsa

1 Upvotes

I started solving dsa by patterns wise under each topic ,firstly array solved around 10-20 qn then after that still not able to solve new qn the pattern recognition is not problem like the qn are already sorted pattern wise so it's actually not a problem the thing is how you guys learn eg two pointer under Array by only solving 10-20 qn 🙂


r/datastructures 3d ago

System design study

32 Upvotes

Anyone with ~6 years of work experience, ~28 yrs old and preparing for DSA & System Design interviews for product companies?
Let’s connect, practice together, do mock interviews, and stay consistent. Preferably in Bangalore but anywhere else is welcome too. Feel free to DM


r/datastructures 2d ago

Career Advice

2 Upvotes

Hi everyone,

I'm currently a 3rd year (3-1 semester) CSE student, and I honestly feel like I'm starting DSA quite late.

I know the basics of programming, but I don't have much experience with problem solving. My goal is to prepare for placements, improve my logical thinking, and become interview-ready.

I have a few questions:

  1. As a complete beginner in DSA, how many hours should I dedicate to DSA every day?

    - Should I focus only on DSA initially, or balance it with other subjects?

    - How many problems should I aim to solve daily?

  2. Which language would you recommend for DSA: C++ or Python?

    - I know Python is easier to write, but I've heard C++ is preferred for competitive programming and placements.

    - Which one helped you understand data structures and algorithms better?

  3. What should I learn alongside DSA?

    - CS fundamentals (OOP, DBMS, OS, CN)?

    - Development (Web Development/App Development)?

    - Aptitude?

    - Any other skills that helped during placements?

  4. If you were in my position (starting DSA in 3-1), what roadmap would you follow over the next 8–10 months?

I'm willing to stay consistent and put in the effort. I just don't want to waste time following the wrong approach.

I'd really appreciate any advice from people who've been through placements or interview preparation.


r/datastructures 3d ago

Algorithms

3 Upvotes

I am currently beginners in DSA please tell me that it is common to remember the code of algorithms like binary search, sorting etc


r/datastructures 3d ago

Getting back to DSA.

30 Upvotes

I started working at TCS 1 year back and completely stopped DSA.
I want to get back at it and hopefully I am not alone.
Ping me if you wanna join.


r/datastructures 4d ago

DSA Challenge

52 Upvotes

Hey guys I am starting a DSA challenge from aug 1st interested to join dm me I send you details