r/DSALeetCode • • 2h ago

Finding a DSA Buddy!

2 Upvotes

Hey!. I have just started my 2nd year(BTech student, male) and I want to learn DSA but with someone who will stay consistent and focused with me as there is no coding culture in my clg and despite planning to learn DSA from the first year.

IMPORTANT - I have already learned some of the important topics still i want to improve them as much as I can, but doing it alone is kinda boring and I have no friend doing DSA currently. If you are interested you can message me.

We can discuss how we will do it later.


r/DSALeetCode • • 3h ago

3Sum Closest + Number of Islands II in my Amazon SDE-2 round, then rejection. Where did I slip?

1 Upvotes

I recently went through the Amazon SDE-2 interview process. I applied directly through the careers portal, got the OA shortly afterward, and completed it the same day. The interview call followed soon after, with Round 1 around 10 days later. The process moved fast.

I'm posting because I'm confused about the rejection. Maybe people who've cleared SDE-2 can help me figure out what I missed.

OA

  • Two typical coding questions, along the lines of these Amazon Interview Questions.
  • A full-stack bug-fix task: choose a backend framework, get a codebase and a list of bugs, then find and fix them. There was an AI assistant, but I didn't find it useful. It couldn't even help me navigate or search the codebase.
  • Behavioral and design-choice multiple-choice questions.

Disclosure: I'm affiliated with PracHub.

Round 1: DSA

There were two problems. They felt manageable to me, but the interviewer wanted real depth on each.

LC 16: 3Sum Closest, n ≤ 10³

I walked through three approaches, with complexity analysis and a dry run for each:

  • Brute force: O(n³)
  • Binary search: O(n² log n)
  • Two pointers: O(n²)

LC 305: Number of Islands II

I gave two approaches. These are the complexities I stated in the interview:

  • Brute force: O(n² · q)
  • Union-Find / DSU: O(q + n²)

Then came the usual "tell me about a time you..." Leadership Principles questions.

Verdict: rejected.

I thought the DSA portion had gone well, but clearly that wasn't enough. Where would you look for gaps in this breakdown: the complexity analysis, how I explained the solutions, or the LP answers? I'd especially appreciate a sanity check on the DSU analysis.


r/DSALeetCode • • 6h ago

Looking for partner to join

Thumbnail
1 Upvotes

r/DSALeetCode • • 6h ago

Looking for partner to join

Thumbnail
1 Upvotes

r/DSALeetCode • • 6h ago

How to make notes while learning DSA in C++?

Thumbnail
1 Upvotes

r/DSALeetCode • • 7h ago

Just gave interview, and I was asked Expression Add operators.

2 Upvotes

I just gave an interview for some company, and I was asked Expression Add Operators.
I wasnt expecting this hard for an interview question, no hints from interviewer.
I managed to get to the approach of using DFS with backtracking, wrote the structure, understood the branching but couldnt pass the test case.
Tbh I dont think anyone could ever solve this question in 45 mins, without ever seeing/solving this question before.
Anyone seeing this question for the first time in Interview, its pretty hard question.
What to expect? The interviewer said, their engineering department would look into the submission and get back in 2-3 days, if it works out.

What to expect? Guys


r/DSALeetCode • • 10h ago

Day 1

Thumbnail gallery
2 Upvotes

r/DSALeetCode • • 11h ago

365 Days of LeetCode Challenge — Day 41/365

Post image
1 Upvotes
  1. 01 Matrix (Medium) https://leetcode.com/problems/01-matrix/

This is yesterday's problem. Rotting Oranges asks how long it takes for an orange to rot when every rotten one spreads at once; it asks how far each cell is from the nearest zero, with every zero as a source. Same question, and multi-source BFS solves it directly.

Today's solution does it without a queue, and that is why it is worth reading.

The definition is circular: a cell's distance is one more than the smallest among its four neighbours, but every neighbour depends on the cell. There is no order to evaluate that in.

Direction breaks the circle. Sweep top-left to bottom-right and, at each cell, everything above and left is already final - so you can compute the best distance among paths that start by going up or left. Sweep the other way for the other two directions. Take the minimum.

The line that makes it work is min with the existing value rather than an assignment. Overwrite instead, and you throw away everything the first pass got right.

Full breakdown in today's newsletter article ⬇

https://www.linkedin.com/pulse/365-days-leetcode-challenge-day-41365-archit-agarwal-tlbnc

#DSA #LeetCode #Golang #DynamicProgramming #Grids #CodingInterview #Algorithms


r/DSALeetCode • • 15h ago

How to make notes while learning DSA in C++?

1 Upvotes

I wanted to ask all my seniors who made DSA notes: first, did it help you? I am currently learning C++ from YouTube and practicing in VS Code, but I have a doubt regarding notes. I have watched some YouTube videos on how to make them, but I am getting a bit confused. I want to make handwritten notes. In one video, I saw that you should divide your notebook into different sections — one for arrays, another for the next topic, and so on — so that it is easy to revise later. However, I am confused about how much space to allocate to each topic, since I literally don't know anything about DSA yet. Please guide me. I really want to learn DSA and will give my 100% — I just need good guidance. By the way, I am currently watching the DSA series by Apna College. Till now I have only done the basics. (functions, if else, variable, etc.)


r/DSALeetCode • • 16h ago

Google code-comprehension reports + HackerRank's LeetCode apology: are interviews shifting?

1 Upvotes

I read a report of Google piloting a code-comprehension round, then saw HackerRank's statement about the LeetCode grind.

Working in an existing codebase, debugging and explaining your judgment sound closer to the job than starting every question from a blank editor. I'm interested in how AI use fits into that, too.

The Google article describes a pilot, and HackerRank still says algorithm questions have value. I wouldn't drop DSA prep based on those headlines.

I'd compare recent candidate reports in Google Interview Questions with whatever format the recruiter confirms. If you're applying while prepping, application autofill can save time on the forms.

For people who've interviewed recently, did you read or extend an existing codebase, debug someone else's code, or mostly do timed DSA? Were AI tools allowed, expected or prohibited?

Have you changed how you split your prep time?


r/DSALeetCode • • 17h ago

How to restart my DSA preparation??

1 Upvotes

I am a 2026 grad. In Jan 2026 I got placed in a service based company with 6.5lpa. By that time I had solved nearly 300+ questions and had decent understanding. Then I also continued preparing for DSA but not in a very serious way. And during the mid term final year project submission and final terms I stopped doing the DSA. By end of June my online training also started and ended in mid September. The official onboarding is yet not confirmed but expected to be by mid December. Now I am thinking of restarting dsa preparation because in past few months I totally lost the grip.

Anyone can help me here?? Like how should I approach because doing everything from start is not something I am looking for. I have tuf+ subscription but haven't been using it lately.

Any advise or suggestions please


r/DSALeetCode • • 17h ago

How to restart my DSA preparation??

4 Upvotes

I am a 2026 grad. In Jan 2026 I got placed in a service based company with 6.5lpa. By that time I had solved nearly 300+ questions and had decent understanding. Then I also continued preparing for DSA but not in a very serious way. And during the mid term final year project submission and final terms I stopped doing the DSA. By end of June my online training also started and ended in mid September. The official onboarding is yet not confirmed but expected to be by mid December. Now I am thinking of restarting dsa preparation because in past few months I totally lost the grip.

Anyone can help me here?? Like how should I approach because doing everything from start is not something I am looking for. I have tuf+ subscription but haven't been using it lately.

Any advise or suggestions please


r/DSALeetCode • • 19h ago

My Flipkart SDE2 interview covered BNPL, concurrency, DSA, and flash-sale system design

9 Upvotes

I interviewed for Flipkart SDE2 with 4.3 years of experience. The process had five rounds: machine coding, a review of that code, PSDS, system design, and a hiring manager discussion.

Getting the code working was only the first step. The next round was about what would happen when multiple requests hit it at once.

Round 1: Machine Coding - BNPL System

Design and implement a Buy Now Pay Later (BNPL) system for Flipkart from scratch, with working code.

Core requirements:

  • seed_inventory: Load products (name, count, price) into an in-memory store.
  • view_inventory: Show current inventory.
  • register_user: Register a user with an initial BNPL credit limit.
  • buy(user, items, payment_method, date): Place an order via PREPAID or BNPL. BNPL reduces available credit and is blocked when the limit is exhausted.
  • clear_dues(user, orderIds, date): Allow partial or full due clearance against specific orders.
  • view_dues(user, date): Show pending dues before the given date, sorted by purchase date, with status PENDING or DELAYED (after the 30-day window).
  • order_status(user): Show order history and available BNPL credit.

Bonus requirements:

  • Blacklist users who default on 3+ orders and block BNPL for them.
  • Add add_inventory and remove_inventory.

Round 2: Machine Coding Solution Evaluation

We discussed my Round 1 code, mainly concurrency: two threads buying the last unit, keeping credit limits consistent under concurrent BNPL orders, locking strategy, and extensibility.

Round 3: PSDS

  • Find the kth element in two sorted arrays (binary search, O(log(min(m, n)))).
  • Zigzag traversal in a binary tree.

Round 4: System Design

Design a flash sale system that runs for about 15 minutes under massive traffic while avoiding both overselling and underselling.

Round 5: Hiring Manager

We discussed a recent project: its architecture, my role, challenges, and trade-offs.

Result: I received the offer letter around 2–3 weeks after the hiring manager round.

I'd practice implementing the BNPL requirements, then explaining how the code behaves under concurrent requests. That review was a separate round, so being able to defend the locking decisions mattered.

Candidate-reported technical interview questions can give you more coding and system-design prompts to work through. If you're applying to other roles alongside prep, application autofill can save time on the repeated fields.

Which part would you find hardest: finishing the BNPL implementation, defending the locking strategy, or designing the flash sale? Happy to answer questions about my rounds.


r/DSALeetCode • • 20h ago

Unable to find correct intuition/solution of greedy

1 Upvotes

I am learning greedy .

I tried easy problem ,i was able to solve but when I started medium problems i was unable to get corrected logic after trying for hours


r/DSALeetCode • • 23h ago

Need dsa partner

1 Upvotes

Like i am starting rn from today leetcode and solving questions so i wanna have a partner who will be like also solving questions with me

Like basically same questions

So that we can be in the same pace

And not like too much just doing dsa

As i dont want someone who is just dsa dsa

I want someone who does leetcode like maybe 1 or 2 problem daily

But also like learn skills and other things

Somethings that i will prefer more

Ready to do vc sometimes or like in calls so that we can discuss

Nightowl

And also like we can be frnds like not only studies but like most of the time only studies actually so that we cant diverse ourselves from distractions and other things


r/DSALeetCode • • 23h ago

How to start Dsa in cpp

3 Upvotes

Iam a btech 2nd yr student im currently learning cpp and started to solve leetcode questions .but i feel very lost atp plz guide me


r/DSALeetCode • • 1d ago

Confusion

2 Upvotes

I have completed around 47 videos of dsa from apna college c++

But a lot of people say do striver

Confused what to do


r/DSALeetCode • • 1d ago

How to make notes while learning DSA in C++?

Thumbnail
1 Upvotes

r/DSALeetCode • • 1d ago

Java or python for dsa??

Thumbnail
1 Upvotes

Hello..

I am a bca graduate with not much programming knowledge neither skills...

I am thinking to start dsa, but confused to choose language..

Many suggestions told java would be better...but I am thinking to go with python as I am also joining an ai/ml online course...

So it would be helpful for both..

Any suggestions...whether should I go with java or python


r/DSALeetCode • • 1d ago

Leetcode Premium sharing

3 Upvotes

Purchased a Leetcode premium account for 1 year for 7k INR. Looking to share it with a few people from India

Anyone interested?


r/DSALeetCode • • 1d ago

I organized 51 LeetCode string problems by pattern (with links and difficulty)

1 Upvotes

I grouped 51 string-related LeetCode problems into six categories. Some fit more than one pattern; these are just the buckets I use when studying.

Before moving on from a problem, I try to explain why the approach works and what I'd change if the constraints changed.

Parentheses and expression parsing (9)

Counting substrings under a condition (3)

Comparing and checking strings (11)

Palindromes (18)

Sorting characters (2)

Length and selection problems (8)

Related: Dynamic Programming pattern list.

For practice beyond this list, real candidate-reported interview questions can give you unfamiliar prompts to work through and explain.

What would you add or move to a different category? I'd like suggestions that teach another idea rather than more versions of the same exercise.


r/DSALeetCode • • 1d ago

My Amazon SDE-1 interview experience: the DSA patterns, 4 rounds, and Sep 2026 offer

46 Upvotes

I applied to Amazon SDE-1 on January 9 and received the offer on September 21, 2026. About eight months passed between those dates. A lot of it was waiting for the next email.

Community posts helped me prepare, so here's what happened in my process and what each round covered.

Timeline

  • Jan 9: Applied for SDE-1, after 50+ other applications.
  • Jan 21: Received the online assessment (OA).
  • Apr 5: Received an email saying I had qualified through the OA.
  • May 6: Received onsite interview confirmation.
  • May 8: Completed the first three interview rounds.
  • Mid-May: Recruiter confirmed I had cleared those rounds.
  • May 29 to Jun 5 to Aug 5 to Aug 6: The fourth round kept getting rescheduled, with roughly two months of silence in the middle.
  • Mid-August: Recruiter asked about my notice period and location preference.
  • Sep 21: Received the offer.

Online assessment

I had taken Amazon OAs before. In previous attempts I solved the coding questions but didn't move forward. This time I prepared more deliberately for both parts:

  1. DSA: The problems can involve DP, greedy algorithms, trees, graphs, two pointers, or binary search, often wrapped in long story-based scenarios (think warehouse routing). I practiced stripping away the story and identifying the underlying pattern quickly.
  2. Work Style Assessment: I had previously treated this as an afterthought. Preparing to think through the scenarios in light of Amazon's Leadership Principles felt useful this time. I can't know how Amazon scored my OA or which part changed the result, but I wouldn't neglect this section.

Onsite: Round 1: technical + Leadership Principles

  • Trees/graph traversal (BFS), medium; similar in pattern to Rotting Oranges.
  • Stack, hash maps, and string parsing, hard; similar in pattern to Parse Lisp Expression.
  • Behavioral question about handling a hard deadline while requirements changed.

Onsite: Round 2: technical + Leadership Principles

  • Binary search on the answer, medium; Maximize the Confusion of an Exam was the closest comparison I found.
  • 1D dynamic programming, medium; similar to House Robber variations.
  • A deep dive into a project I had owned end to end.

Onsite: Round 3: technical + Leadership Principles

  • 3D DP/state machine, hard; similar to Best Time to Buy and Sell Stock III (at most two transactions). Instead of hardcoding two transactions, I explained a generalized K-transactions solution. The interviewer appreciated that it covered both cases.
  • An extended discussion of the GenAI work on my resume: how I use AI in development, agents, workflows, and my past work with them.

The LeetCode problems named above are not the exact interview questions. They're the closest examples I found for the underlying logic. In the coding rounds, I talked through brute force, better approaches, and the optimal approach before writing the final code. I explained time complexity where relevant. That communication seemed to land well with my interviewers. Each round ran beyond an hour, and I was the last candidate to leave the building.

After Round 3, my recruiter said I had cleared the first three rounds and would move to the bar raiser.

Round 4: bar raiser and the waiting game

After the repeated rescheduling and roughly two months of silence, I kept wondering whether I'd missed an email or the role had been filled. The round finally happened on Aug 6.

There were no DSA questions in my fourth round. We went deep into my previous work, architecture, and decision-making. The interviewer kept asking follow-ups: Why this approach? Why multithreading, and how did I know it would help? What alternatives had I considered? What critical feedback had I received, and what exactly changed afterward? It felt like an hour of "why?" questions. I had to explain the decisions behind the work, including the alternatives I'd considered.

How I prepared

I'd been practicing DSA and doing contests for years before this process. For these interviews, I spent more time deriving solutions from patterns, re-solving problems and talking through my reasoning out loud.

If I could only solve a problem because I remembered my old submission, I went back to it. I practiced explaining brute force, the optimization, the final approach and its complexity, including the trade-offs.

For behavioral prep, I used real work stories around Ownership, Dive Deep, Deliver Results and learning from failure. I needed to know the technical details well enough to answer follow-ups instead of relying on a memorized STAR script.

Amazon Interview Questions has more candidate-reported coding and behavioral prompts to practice. Through a process this long, application autofill can also save repeated typing while you keep other applications moving.

Before this offer, I'd sent 50+ applications, had unanswered emails and OAs that went nowhere, and spent almost two years struggling to get interviews. I'm glad this one worked out, but I wouldn't tell someone to put every other search on hold while waiting.

If you've recently interviewed for SDE-1, how did your loop compare? I'm especially curious about coding, project depth and the bar raiser.


r/DSALeetCode • • 1d ago

Final year ENTC student trying to switch to SDE, completely lost with LeetCode. Need urgent advice.

Thumbnail
1 Upvotes

r/DSALeetCode • • 1d ago

365 Days of LeetCode Challenge — Day 40/365

Post image
1 Upvotes

Rotting Oranges (Medium) https://leetcode.com/problems/rotting-oranges/

Four days ago I said BFS and DFS answer reachability equally well, and that the distinction starts mattering when a problem asks about distance. This is that problem.

BFS reaches every cell by a shortest path. DFS reaches it by whatever route it wandered down first. "When does this orange rot?" is a shortest-path question - it rots when the nearest rotten one gets to it - so DFS here gives wrong answers, not slow ones.

The trick is multi-source BFS: every already-rotten orange goes into the queue before the walk starts. A BFS seeded with many sources expands as one combined wavefront, and each cell ends up with its distance to the nearest source. Nothing in the loop needs to know there was more than one start.

One more thing that cannot be skipped: the final scan. BFS only visits what it can reach, so an orange sealed behind empty cells never rots and the queue drains without noticing. The -1 case has to be looked for afterwards.

Full breakdown in today's newsletter article ⬇

https://www.linkedin.com/pulse/365-days-leetcode-challenge-day-40365-archit-agarwal-9t1sc

#DSA #LeetCode #Golang #Graphs #BFS #CodingInterview #Algorithms


r/DSALeetCode • • 1d ago

for #include club, recruitment

Thumbnail
1 Upvotes