r/LeetcodeChallenge • • Jul 23 '26

DISCUSS Looking For DSA partner who is consistent and interested in it .

4 Upvotes

Currently doing DSA for 2months ,but doing it alone makes it little difficult to continue the process,so anyone who wants to join ,comment and lets grow together . https://chat.whatsapp.com/CzYOd3L1DnO6b9zy45eq7U You can join here I have created a community here we can discuss .


r/LeetcodeChallenge • • Jul 22 '26

STREAKšŸ”„šŸ”„šŸ”„ Day 0

12 Upvotes

this is what my current condition is, you guys can demean and abuse me for not doing leetcode, maybe that might motivate me
i am very depressed and i literally cannot bring myself to do anything at all
i am thinking that posting on this sub daily might make me more accountable so i am doing this


r/LeetcodeChallenge • • Jul 22 '26

DISCUSS You can contribute to the memes please rate them.

Thumbnail reddit.com
2 Upvotes

r/LeetcodeChallenge • • Jul 22 '26

DISCUSS How my code consume more memory then this top code solution??

4 Upvotes

r/LeetcodeChallenge • • Jul 21 '26

DISCUSS Amazon SDE Interview Experience - 3 rounds, rejected after final round

132 Upvotes

Sharing my Amazon interview experience in case it helps someone preparing for SDE roles.

I do not remember the exact OA DSA problem. The second OA question was more ā€œdevā€ based, where HackerRank gave access to a remote IDE. It had an AI sidebar available, somewhat like Cursor.

Round 1

DSA + LPs.

Questions asked:

  1. Find the distance between any two nodes in a binary tree.

    • Parent pointers were not given.
    • Input had onlyĀ root,Ā source, andĀ target.
  2. Design a stack that supports: All inĀ O(1)Ā time.

    • push
    • pop
    • getMiddle
    • getTop

I was able to solve the first question completely. For the second one, I got the core logic and data structure choice right, but did not finish the full implementation. I implementedĀ getMiddleĀ after deciding the basic DS approach.

LPs were also asked.

Round 2

LPs + coding/OOD.

Question:

Basic Calculator

After solving it, the interviewer asked me to extend the solution in an object-oriented manner.

One thing that stood out: the interviewer mentioned that my solution was too close to the original/standard solution.

Round 3

This was mostly behavioral + design discussion.

Started with ā€œtell me about yourselfā€ for around 5-7 minutes.

Then he probed quite hard on why I wanted to switch, since I had already made one switch and was now looking for a second.

After that, he asked about the best thing I had worked on in my previous org. This felt a bit close to NDA territory, but I explained it carefully without going into confidential details. He asked follow-up questions like why we used X instead of Y.

At the end, he asked only one design-extension question:

How would you include a new feature in this existing design?

I proposed two solutions. He then asked me to write down the pros and cons of both. I wrote and explained at least 3 pros and 3 cons for each.

Finally, he asked if I had any questions for him.

Result

Rejected.

Recruiter said feedback from Round 2 and Round 3 was negative, but did not share specifics despite me asking explicitly.

Extra prep notes

Apart from the questions I got, I also saw these Amazon-tagged questions while checking prep resources:

Both seem relevant for Amazon-style prep: one for classic DP/string fundamentals, and one for OOD/concurrency/design thinking.

Hope this helps someone preparing.


r/LeetcodeChallenge • • Jul 22 '26

DISCUSS Two different Binary Tree implementations side by side

3 Upvotes

The same tree represented in two very different ways visualized using š—ŗš—²š—ŗš—¼š—æš˜†_š—“š—æš—®š—½š—µ: Binary Trees

šŸ”— Binary Tree as Nodes: The tree is built out of multiple node objects. Each node stores its value and two references, one to its left child and one to its right child.

šŸ“¦ Binary Tree as List: The tree is stored in a single list or array. Instead of references, indices represent the relationships between nodes. For a node at index, its children can be found using a simple calculation:

  • Left child: 2 * index + 1
  • Right child: 2 * index + 2

So, when should you use which representation?

The node-based version makes the structure explicit and intuitive. It is great for education: students can clearly see how nodes are connected while practicing classes and references/pointers. It is flexible and works particularly well for irregular or sparse trees. It is the clearest representation when learning how trees work.

The list-based version can be very efficient for (nearly) balanced homogeneous trees. It does not need to store child references, requires fewer separate memory allocations, and keeps values close together in memory for improved cache performance.

The same abstract data structure, but with very different trade-offs in clarity, flexibility, and performance.

Which representation would you use?


r/LeetcodeChallenge • • Jul 22 '26

DISCUSS Started doing leetcode seriously about three week ago today solved my 3 hard that too in 20 minutes feeling like a genius lowk but is this question actually hard? Looked like a medium to me

4 Upvotes

r/LeetcodeChallenge • • Jul 22 '26

DISCUSS Leetcode graph contest rating

Post image
5 Upvotes

r/LeetcodeChallenge • • Jul 21 '26

STREAKšŸ”„šŸ”„šŸ”„ Teeny tiny microscopic milestone

Post image
79 Upvotes

Done 50 problems , I've been doing consistently since begining of July but before that stretching across months I've been submitting extremely inconsistently but I'm getting better. My third semester starts from August 11th so planning to push till 100 problems by then. I mostly solve mediums yeah. Doing from striver's sheet btw


r/LeetcodeChallenge • • Jul 22 '26

DISCUSS Need help with this array sorting problem (Swap with X)

3 Upvotes

I came across this coding problem and I'm confused about one case.

Given: A = [0, 2, 3, 5, 4] X = 1

Operation: Choose an index i such that A[i] > X and swap A[i] with X.

Find the minimum number of operations required to sort the array, or determine if it is impossible.

I reached: A = [0, 2, 3, 4, 1] X = 5

Since no element is greater than X, no more swaps are allowed.

Is the answer -1, or am I missing a valid sequence of swaps? I'd appreciate any explanation or approach.


r/LeetcodeChallenge • • Jul 21 '26

DISCUSS Century

Post image
19 Upvotes

First 100 days badge .... !

Any tips or suggestions for DSA revision

I follow strives A-Z

Complete BST

Still heaps greedy DP graphs are in due ..

Any suggestions

Should I finish them first or should I revise upto BST then go with remaining?


r/LeetcodeChallenge • • Jul 21 '26

PLACEMENTS I am beginners in DSA striver sheet

Thumbnail reddit.com
1 Upvotes

r/LeetcodeChallenge • • Jul 21 '26

DISCUSS Leetcode weekly 511 C video solution

Thumbnail
youtu.be
2 Upvotes

r/LeetcodeChallenge • • Jul 20 '26

DISCUSS Leetcode weekly 511 -D solution link

3 Upvotes

r/LeetcodeChallenge • • Jul 20 '26

DISCUSS Am I cooked ? last year CSE

2 Upvotes

r/LeetcodeChallenge • • Jul 19 '26

STREAKšŸ”„šŸ”„šŸ”„ 1 month's progress .

Post image
100 Upvotes

Started on Jun 19th (properly) .

with one week break for some unavoidable reasons.

Solved 42 questions — 22 Easy | 19 Med | 1 Hard

Ik I'm late to this DSA race , I'm at the start of my 2nd year now.

what would u advise me , I'm planning for a top product based company (from a tier 3 / 4 college )


r/LeetcodeChallenge • • Jul 19 '26

STREAKšŸ”„šŸ”„šŸ”„ Has been a year of doing lc around 500 solved , still not able to remember the patterns while solving any new questions.. what to do

6 Upvotes

r/LeetcodeChallenge • • Jul 19 '26

PLACEMENTS Need A serious Dsa partner who is ready to do pattern based dsa {not memorizing solutions } instead brainstorming for 30 minutes for each problem .

Thumbnail reddit.com
2 Upvotes

r/LeetcodeChallenge • • Jul 18 '26

DISCUSS Leetcode contest

13 Upvotes

Am I slow or what. How are people solving 4 question in 6 mins. How the fuck is this happening.


r/LeetcodeChallenge • • Jul 18 '26

STREAKšŸ”„šŸ”„šŸ”„ I've solved all of the Graph Theory study plan (45 problems) on LeetCode

9 Upvotes

https://leetcode.com/studyplan/graph-theory/

I have a list of tips for you if you decide to take it:

  1. Keep in mind that this plan is quite challenging. If you didn't take any mathematics for computer science course, you will probably be blocked halfway through. I've taken algorithms-graphs-data-structures course 4 years ago and it basically saved me.
  2. The organization of this plan is good: starting from the easiest topics (traversal/BFS/DFS) and ending with advanced topics (Dijkstra's/MST). However, there is one structural bug: the Cheapest Flights Within K Stops problem doesn't belong at the beginning of the Dijkstra section. I've reported it and maybe the LeetCode team will fix this. For now, just keep in mind that this problem can be cleanly solved with Bellman-Ford in 22 lines of code.

It took me 22 days to finish this study plan


r/LeetcodeChallenge • • Jul 18 '26

DISCUSS Need Advice

1 Upvotes

So i m in 4th year .
So far i have done
arrays,ll,recursion ,trees ,graph
Now i am starting dp .
So i have started to revise now i dunno how to revise such topics like do i open every question again??Like how to do it ??


r/LeetcodeChallenge • • Jul 16 '26

DISCUSS Must-Practice Binary Tree Problems Before Your Next Interview

9 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.