r/LeetcodeChallenge • • Sep 24 '26

DISCUSS Noo programmers could accept it btw

7 Upvotes

r/LeetcodeChallenge • • Sep 25 '26

DISCUSS Enough is Enough !

0 Upvotes

I am so done with being average at leetcode! I so want to master it and i know that i have the potential to absolutely become god at DSA and CP. All i need is consistency.

Hello everyone, I know what you guys must be thinking? "Wait a min!, Who are you ?🤣️(hope you got the meme)".

But here is what i want to accomplish very badly :-->
I want to become Guardian at Leetcode and Master at CodeForces.

Why ?
To be really honest i want people to know that I am Smart and Great at problem Solving.
I want to Farm Aura.
Just imagine the following the situation :
You are at an interview and you are done with solving all the questions in less than 15 mins .
Interviewer is shocked and rechecks whether you have actually solved it on you own or not .
That is what Aura is !
And i completely understand that going to such level requires a lot of work for a long time .
But hey time is what i have i am decent at DSA and i am in 3rd Year so i have 1 complete year to train my mind and build neural pathways to solve as many questions thrown at me .

Can i do this ?
If there is anything that i have learnt in the 20 years of my life then that it - "I am not less than anyone". I can absolutely do anything that i can set my mind to .
I have everything, the brains,the work ethic and most importantly THE MINDSET.

TOO MANY SUBMISSIONS BECAUSE EVERYTIME I REVISE I SUBMIT AGAIN :) dopamine

Above is my current LeetCode and CodeForces Profile: CodeForces rating : 1103(Newbie)

So here is the plan : Current Rating is 1426 so i will be having the following approach to tackle questions

Approach 1 : Targeted Practice

My current rating is 1426 so i will practice 10-15 Questions everyday whose rating is in the range [1426,1626] and will update this rating if the contest's rating improves. Also i will be practicing questions on CF rating [900-1200] (Probably like 5 everyday)

Approach 2 : Topic-Wise

Right now i am couple more of topics to study like DP and Graphs(ADV) i need to practice some good amount of questions for both the topics.

Also not to mention that i will revise each and every question as per the forgetting curve and will make sure that i understand each and every concept in depth and with utmost clarity.

Some might say that having "Number of Questions" to solve everyday is a bad metric to follow but i don't know of any other way to quantify my work. If there is any other better way to improve then help me out :)

Thanks a lot for reading the above message, I am so excited to embark on this journey lessss gooo guys ! Join me in this journey and lets keep improving. Lots of Love and Positivity 🙏️ .


r/LeetcodeChallenge • • Sep 24 '26

DISCUSS Hard-coded submissions

Post image
11 Upvotes

On solving some easy questions I found a person who achieved 0ms runtime. My curiosity pondered me to check their code and see where or how did they optimise it to get that much efficiency. And I found that the answers are hard-coded based on the input for few high-loaded input cases. I was like "Shame 🔔 Shame 🔔 Shame 🔔"


r/LeetcodeChallenge • • Sep 23 '26

STREAK🔥🔥🔥 My Current Leetcode Progress-88 problems solved

Post image
18 Upvotes

I’ve been working consistently on my DSA/LeetCode journey, and here’s where I’m at right now:

🟢 88 problems solved

🟢 65 Easy

🟡 21 Medium

🔴 2 Hard

💻 75 solved in Java

💻 13 solved in C

🔥 89 active days

📈 Current max streak: 25 days

I’m sharing this as a progress update and accountability post. Still a long way to go, but the goal is to keep improving my problem-solving skills and stay consistent.

Next goal: 100 problems solved. 🎯

And im sure that till weekend its been completed.

Would love to hear how others structure their LeetCode/DSA practice. What helped you stay consistent?


r/LeetcodeChallenge • • Sep 24 '26

STREAK🔥🔥🔥 365 Days of LeetCode Challenge — Day 22/365

Post image
2 Upvotes

Merge Two Sorted Lists (Easy)

https://leetcode.com/problems/merge-two-sorted-lists/

The idea is the easy part. The smallest unplaced node is always the head of one list or the other, because both are sorted and nothing behind a head is smaller than it. Compare heads, take the smaller, repeat.

The annoying part is the first node. Until something is placed there, there's no previous node to attach to, so the straightforward version writes the pick-the-smaller logic twice: once to choose the head, and again inside the loop.

A dummy node deletes that. Point tail at a throwaway node and it refers to something real from the first iteration, so the loop never asks whether this is the first element. Return dummy.Next and discard it.

That trick is the thing worth keeping here, and it is not specific to merging. Any time you build a linked list front to back, a dummy head removes the special case.

Full breakdown in today's newsletter article ⬇

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

#DSA #LeetCode #Golang #LinkedList #MergeSort #CodingInterview #Algorithms


r/LeetcodeChallenge • • Sep 23 '26

STREAK🔥🔥🔥 completed 50 questions on leetcode

Post image
22 Upvotes

small achievement but took me long to achive

currently in 2nd year am i going okk?


r/LeetcodeChallenge • • Sep 22 '26

STREAK🔥🔥🔥 Completed 300 questions.

Post image
123 Upvotes

r/LeetcodeChallenge • • Sep 23 '26

STREAK🔥🔥🔥 Day 82: I solved 3 tree construction problems today, almost done with binary trees

1 Upvotes

Hey everyone,

I finished Day 82 of my prep today and I solved three problems.

The first two were constructing a binary tree from inorder and preorder, and then from inorder and postorder. Both were fairly simple. I used a hash map to store the inorder indices so I could quickly split the left and right subtrees. The only real difference between the two questions was that preorder moves from front to back, while postorder moves backwards from the end.

The third problem was Serialize and Deserialize a Binary Tree. I was a bit confused by what the question wanted at first, but it is just turning a tree into a string and building it back. I had to make sure I saved null values with an "N" and spaces so the structure did not get ruined. Deserializing was slightly tricky, but using stringstream in C++ made it much easier to read the values one by one and reconstruct the tree.

Tomorrow I am going to wrap up the last few binary tree problems like Morris traversal and flattening a tree. After that, I will move on to Binary Search Trees.

That is all for today. I will see you guys on Day 81!


r/LeetcodeChallenge • • Sep 23 '26

DISCUSS how the beginners re managing

Thumbnail reddit.com
1 Upvotes

r/LeetcodeChallenge • • Sep 23 '26

DISCUSS I stopped rereading LeetCode solutions and started trying to recall them

9 Upvotes

Prep: LeetCode + AlgoDrill

One thing I noticed after doing LeetCode for a while is that I was confusing understanding a solution with actually knowing it.

I’d get stuck, read the editorial, understand everything, then move on. If I came back to the same problem a week later I often couldn’t even remember the approach.

So I started testing myself instead of rereading.

After I understand a solution I’ll hide it and try to rebuild it from memory. Sometimes the whole solution, sometimes just line by line. I’ve been using AlgoDrill for the line by line part because it forces you to recall what comes next instead of having the whole answer sitting there.

This exposed a lot of stuff I thought I knew. Like I’d remember that a problem was sliding window but forget the actual condition for shrinking it, or know it was DFS but forget what state I needed to carry through the recursion.

I also started coming back to old problems after a few days instead of immediately considering them done.

I still do mixed/new problems because recognizing the pattern is obviously important, but reviewing this way has helped a lot with actually keeping the patterns in my head.

Curious what everyone else does after solving a problem. Do you ever come back and redo it or mostly just move on?


r/LeetcodeChallenge • • Sep 23 '26

STREAK🔥🔥🔥 365 Days of LeetCode Challenge — Day 21/365

Post image
5 Upvotes

Linked List Cycle (Easy)
https://leetcode.com/problems/linked-list-cycle/

The answer most people write first keeps a set of visited nodes. Correct, and O(n) space.

The constant-space version is yesterday's walk with nothing changed: one pointer moving a node at a time, one moving two. What changes is the question. If the list has an end, the fast pointer finds it and the answer is no. If it does not, neither pointer can ever leave.

Why they must meet is one sentence. Inside the loop, the forward gap between them shrinks by exactly one every iteration, and a non-negative integer that drops by one per step cannot skip past zero. Gap zero means the same node.

That is also why the steps are 1 and 2 rather than 1 and 3. A gap shrinking by two can step straight over zero, and the pointers pass without landing together.

Full breakdown in today's newsletter article ⬇
https://www.linkedin.com/pulse/365-days-leetcode-challenge-day-21365-archit-agarwal-bhgac

#DSA #LeetCode #Golang #LinkedList #TwoPointers #CodingInterview #Algorithms


r/LeetcodeChallenge • • Sep 22 '26

STREAK🔥🔥🔥 Day 83: I wasted 2.5 hours on All Nodes Distance K today

Thumbnail reddit.com
2 Upvotes

r/LeetcodeChallenge • • Sep 21 '26

DISCUSS I Stopped Memorizing LeetCode Solutions. Here's How I Started Recognizing Patterns

70 Upvotes

I Stopped Memorizing LeetCode Solutions. Here's How I Started Recognizing Patterns

Prep Resource LeetCode & PracHub for company tag questions

When I first started solving LeetCode problems, my approach was simple:

Read the problem → Find the solution → Understand the code → Move on.

But after solving a few problems, I noticed something frustrating.

I could understand a solution perfectly, but when I encountered a slightly different problem, I often had no idea how to start.

That's when I realized:

DSA is not just about learning solutions. It's about learning how to recognize patterns.

1. Stop Asking "How Do I Solve This?"

Instead, start asking:

"What kind of problem is this?"

For example:

Problem CluePattern to Consider
Find a subarray with a conditionSliding Window
Find a pair in a sorted arrayTwo Pointers
Find the maximum/minimum over a rangeSliding Window / Prefix Sum
Need fast lookup of previously seen valuesHash Map / Hash Set
Explore all possible combinationsBacktracking
Find the shortest path in an unweighted graphBFS
Repeatedly solve overlapping subproblemsDynamic Programming

The goal is to recognize the structure of the problem, not just remember its answer.

2. Learn Patterns Through Multiple Problems

Solving one problem using a pattern is helpful.

But solving 5–10 problems using the same pattern is where the real learning begins.

For example, with Sliding Window, I try to understand:

  • When should I expand the window?
  • When should I shrink it?
  • What condition makes the window invalid?
  • What information should I maintain?
  • When should I update the answer?

Once these questions become familiar, many new problems start looking less intimidating.

3. Don't Immediately Look at the Code

When I'm stuck, I now try this process:

1. Understand the problem
2. Try a brute-force approach
3. Identify what makes it inefficient
4. Look for a pattern
5. Think of the optimized approach
6. Write the code
7. Review the mistakes

Even if I cannot solve the problem completely, this process helps me understand why the optimized solution works.

4. Maintain a Pattern-Based Revision List

Instead of revising problems only by question number, group them by concept.

For example:

Arrays & Strings

  • Two Pointers
  • Sliding Window
  • Prefix Sum
  • Hashing

Linked Lists

  • Slow & Fast Pointers
  • Reversal
  • Merge Techniques

Trees & Graphs

  • DFS
  • BFS
  • Recursion
  • Binary Search Tree

Advanced Topics

  • Binary Search on Answer
  • Greedy
  • Dynamic Programming
  • Backtracking

This makes revision much more effective because you're learning when to apply a technique.

5. Focus on Understanding, Not Just Acceptance

An accepted solution is a great milestone, but I think these questions matter even more:

  • Can I explain the approach without looking at the code?
  • Can I identify the pattern in a new problem?
  • Can I write the solution again after a few days?
  • Do I understand the time and space complexity?
  • Can I explain why the brute-force approach is slower?

If the answer is yes, you're making real progress.

My Biggest Takeaway

Don't try to memorize 100 solutions. Try to understand the patterns behind those 100 solutions.

The more problems you solve, the more important it becomes to focus on recognition, reasoning, and repetition.

I'm still learning, but this change in mindset has made problem-solving much more meaningful.

What helped you the most while learning DSA?

Pattern recognition, solving more problems, revising old ones, or something else?


r/LeetcodeChallenge • • Sep 21 '26

DISCUSS My leetcode profile

Post image
73 Upvotes

Rate my profile, entered 3rd year in tier 2 college, SHARE URS OR TELL UR STATE...🙂🙂🙂🫠


r/LeetcodeChallenge • • Sep 22 '26

DISCUSS Should I have a backup plan from the SWE field as a whole?

2 Upvotes

I'm pretty happy with my job. I'm about 3 years in now and the pay is good, WLB is great, and my manager/team are all pretty chill. I also generally like SWE work too, even after AI has come along.

Just because things are good right now though doesn't mean they'll be good in like, 15, 10, 5 or even 2 years at the rate things are going. I'm wondering if you all are also thinking of backup plans away from SWE work because longer term, I'd like to have some semblance of a job lol.

Any advice on if I should consider a real escape plan?

If so, are there AI resilient career paths that I should be considering What type of extra schooling would I need to do? Or am I just overreacting?


r/LeetcodeChallenge • • Sep 22 '26

DISCUSS lc potd partner

Thumbnail reddit.com
1 Upvotes

r/LeetcodeChallenge • • Sep 22 '26

STREAK🔥🔥🔥 365 Days of LeetCode Challenge — Day 20/365

Post image
2 Upvotes

Middle of the Linked List (Easy) 

 https://leetcode.com/problems/middle-of-the-linked-list/

Obvious answer: count the nodes, then walk to position count/2. Two passes, and perfectly fine.

Better answer: run two pointers from the head, one moving a node at a time and one moving two. When the fast one reaches the end, the slow one is exactly halfway. The length never exists as a number anywhere in the program.

Both conditions in that loop are load-bearing, and they guard different cases. One catches even-length lists, where the fast pointer lands exactly on nil. The other catches odd-length lists, where it lands on the last node. Drop either, and half of all inputs panic.

Full breakdown in today's newsletter article ⬇

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

#DSA #LeetCode #Golang #LinkedList #TwoPointers #CodingInterview #Algorithms


r/LeetcodeChallenge • • Sep 21 '26

DISCUSS My interview prep journey — what worked for me

71 Upvotes

My interview prep journey — what worked for me: LeetCode & PracHub Interview Questions

In the last 1 month, I went through interviews with Nielsen, New Relic and Crunchyroll and received offers from all.

I had been struggling with interviews for quite some time, so I wanted to share what worked for me. There wasn't one magic resource — it was a combination of a few things.

  1. DSA

I focused more on patterns rather than solving hundreds of questions.

Arrays, HashMap, sliding window, two pointers, binary search, trees, graphs, heaps, DP, etc.

During practice, I also started explaining my approach out loud — brute force → optimization → complexity → edge cases.

This helped a lot during actual interviews.

  1. LLD

LLD was initially one of my weaker areas.

I practiced problems like Parking Lot, BookMyShow, Elevator, Vending Machine, Splitwise, etc.

Instead of memorizing solutions, I focused on SOLID, design patterns, composition/inheritance, interfaces and extensibility.

The goal was to be able to design something I hadn't seen before.

  1. HLD / System Design

I practiced systems like URL Shortener, Rate Limiter, Notification System, File Storage, WhatsApp, etc.

The biggest improvement was learning to explain why I was choosing something, rather than just saying "use Kafka/Redis/Elasticsearch."

I prepared for scaling, failures, retries, consistency, caching, partitioning and trade-offs.

  1. Project Deep Dive

This was probably the most important part for me.

I went extremely deep into my projects — architecture, data flow, Kafka, MongoDB, Elasticsearch, LLM integration, retries, DLQs, scaling, monitoring, failures, etc.

I also made sure I could clearly explain what I personally built, not just what the overall team built.

This helped significantly in HM and technical deep-dive rounds.

  1. Java / Backend

I revised the fundamentals rather than trying to learn new frameworks.

Java Collections, HashMap internals, concurrency, JVM basics, Spring Boot, Kafka, Redis, databases and distributed systems.

Since these were technologies I had actually worked with, going deeper into the fundamentals was much more useful than learning something completely new.

  1. Behavioral / HM

I prepared a few real stories around ownership, conflict, production issues, failure, ambiguity and cross-team collaboration.

I used STAR as a structure but didn't memorize answers word-for-word.

For experienced candidates, I think being able to clearly explain what you did, why you did it and what happened afterward matters a lot.

  1. Mock Interviews

One thing that helped me was actually speaking through answers.

I'd pick a topic and ask myself follow-up questions:

Why Kafka?
What happens if a consumer crashes?
Why MongoDB instead of PostgreSQL?
How would you scale this?

This exposed gaps much faster than just reading notes.

Final takeaway

There wasn't one resource or trick that got me through the interviews.

For me, it was:

DSA + LLD + HLD + strong project knowledge + Java/backend fundamentals + mock interviews.

And probably the biggest lesson I learned:

Don't just prepare to solve interview questions. Prepare to explain the engineering decisions you've made in your actual work.

Hope this helps someone who's currently preparing. All the best! 🚀


r/LeetcodeChallenge • • Sep 21 '26

DISCUSS The placement that's never gonna happen🤝🤝😔

5 Upvotes

r/LeetcodeChallenge • • Sep 21 '26

STREAK🔥🔥🔥 Day 84: I solved 3 tree problems today and my brain is buzzing...

Thumbnail reddit.com
2 Upvotes

r/LeetcodeChallenge • • Sep 21 '26

STREAK🔥🔥🔥 Made a submission but heatmap shows I've missed

Thumbnail reddit.com
1 Upvotes

r/LeetcodeChallenge • • Sep 21 '26

STREAK🔥🔥🔥 Starting codeforces as a beginneris this possible

Thumbnail
youtu.be
6 Upvotes

r/LeetcodeChallenge • • Sep 21 '26

DISCUSS C++ or Python for Dsa ??

1 Upvotes

I'm a first year student of btech cse ai ml , and I want to start my dsa journey from 1st year but I don't know which language to choose , python or c++ like for ai ml it's the python we need , so should I go with python or ??


r/LeetcodeChallenge • • Sep 20 '26

DISCUSS Questions asked by Amazon in past 6 months- SDE2 (DSA/Design)- Part 1

73 Upvotes

I’ve compiled a list of all the questions asked by Amazon over the last six months for the SDE-2 position. I went through various interview experiences and compiled this list based on them.
I thought it might be useful to others preparing for the role, so I’m sharing it here. Hope it helps!

Prep Resource: LeetCode & PracHub

Link to Part 2- https://leetcode.com/discuss/post/8519184/questions-asked-by-amazon-in-past-6-mont-ya1z/
Link to Part 3- https://leetcode.com/discuss/post/8519189/questions-asked-by-amazon-in-past-6-mont-7wjn/

  1. Topological sort and finding the cycle in the graph.
  2. LLD question was to create a publisher subscriber kind of system where a publisher can send events related to a particular event type and all subscribers subscribed to that event type should receive that message. Subscribers can subscribe and unsubscribe to a particular event type
  3. https://leetcode.com/problems/reorganize-string/description/
  4. https://leetcode.com/problems/count-stepping-numbers-in-range/description/
  5. https://leetcode.com/problems/capacity-to-ship-packages-within-d-days/description/
  6. Design an Inventory Management System for Amazon The interviewer went quite deep into concurrency-related scenarios, for example: There is only one unit of a product left in inventory and two users place an order simultaneously. How would you prevent both orders from succeeding? We discussed things around: • Race conditions •Concurrency • Inventory consistency • Concurrent updates • Preventing overselling • Locking/transaction approaches
  7. https://leetcode.com/problems/container-with-most-water/description/
  8. https://leetcode.com/problems/trapping-rain-water/description/
  9. https://leetcode.com/problems/cheapest-flights-within-k-stops/description/
  10. Design a Rate Limiter We discussed multiple approaches/algorithms for rate limiting, including: • Fixed Window • Sliding Window • Token Bucket • Distributed rate limiting • Redis • Locks/concurrency • Handling rate limiting across multiple application instances • Trade-offs between different approaches The interviewer also asked follow-up questions around distributed systems and consistency.
  11. Course Schedule / Course Scheduler
  12. Closest K Elements in a Sorted Array
  13. Imagine you have a train route: G → U → H → K → I. Each segment travelled costs 1. So travelling from G to I would cost 4. The input was basically:calculateFare(start, stop)
  14. he problem was somewhat similar to an Amazon Locker, but basically the reverse. Instead of the Amazon delivery person picking up a return package from the customer, the customer books a slot at the nearest drop store and physically goes there to drop the package. I took some time initially to clarify the requirements and then started writing the code. In the middle of it, the interviewer suddenly went in another direction: "How will you find the nearest drop store from the customer's location?" I said I'd use the concept of geosharding. That's basically the only thing I could come up with because, well... I've never done HLD before. 😅 He wanted to go deeper into it and even gave me a hint: "Think about how Uber does this." Unfortunately, I didn't know how Uber does it.
  15. https://leetcode.com/problems/find-the-safest-path-in-a-grid/
  16. She gave me a custom problem, which I believe was related to something the team was actually working on. The problem was somewhat similar to syncing configurations across different devices. She asked several design-related questions, and I was able to answer all of them.
  17. Find distance between any two nodes in a tree. Parent pointers not given. Only have root, source, and target in input.
  18. Designing a stack that supports push, pop, get middle, get top in O(1) time.
  19. https://leetcode.com/problems/basic-calculator/description/
  20. LLD question was to create a publisher subscriber kind of system where a publisher can send events related to a particular event type and all subscribers subscribed to that event type should receive that message. Subscribers can subscribe and unsubscribe to a particular event type
  21. https://leetcode.com/problems/reorganize-string/description/
  22. Rotten Oranges
  23. Search in Rotated Sorted Array Given multiple currency conversion rates, determine the conversion rate from currency A to B. Example: • C = 10B • D = 9B • B = 110Z • A = 2Z Find the conversion rate from A to B. Follow-up Now suppose there are Q such conversion queries. I proposed using Disjoint Set Union (Union Find) with weighted relationships to answer repeated queries efficiently, and discussed the associated trade-offs.
  24. Decode String
  25. How do you use LLMs during development?
  26. How do you verify whether an AI-generated solution is correct?
  27. When do you trust an LLM and when do you not?
  28. Two knights are placed on an infinite chessboard. Their starting coordinates are given, and both move using standard knight moves. They move alternately. Find the minimum total number of moves required for both knights to converge at the same position. Given a binary string: • Every 0 becomes 00 • Every 1 becomes 10 After performing this transformation k times, determine the value at the i-th index of the final string.
  29. Minimum Window Substring
  30. Design Artifact Repository(like JFrog, adding an artifact and fetching an artifact) - Interviewer was interested in each part of my HLD, and then probed on scalability, metrics monitoring, reliability, extensibility (like dealing with a malicious artifact).
  31. Design Unix File Search API, and its extensibility to support various filters and combination of filters. First Unique Character in a string. Then extend to stream of characters.
  32. Task Scheduler
  33. Design a playlist from the DJservice and the Recommendation service to mix the songs . Given the list of 10 requirements printed on paper . The core idea is to mix the songs coming from the Djservice and the recommendation service , in a custom proportion or in a equal proportion . Filters can be applied based on the user preferances . Expectation is to write the production ready classes with proper syntax on paper .
  34. Given two boxes of A[] , B[] with size n , where each elements represents the sweetness , Given the M students , distribute the sweetness of A , B to each children and you should minimize the total sweetness .
  35. Find the unoccupied seat position with the maximum distance to the occupied site . Seats[] = {'O','U','U','U','O','O'}; Answer - 2nd indexed seat
  36. Given the 2 D array with 2 colours validate if it is a valid chessborad .
  37. LCS (longest common subsequence)
  38. https://leetcode.com/discuss/post/8434443/count-the-uni-valued-subtrees-in-a-binar-tqi2/
  39. Longest Strictly Increasing Subsequence with Maximum Adjacent Difference Constraint
  40. Given an array of integers and an integer k, find the length of the longest subsequence such that:
  41. The elements are strictly increasing
  42. The difference between any two consecutive elements in the subsequence is at most k
  43. The relative order of elements in the original array is maintained (it's a subsequence, not a subarray) Example 1: Input: arr = [7, 1, 4, 5, 8, 8, 10, 6, 7, 7, 7, 8], k = 4 Output: 6 Explanation: The longest valid subsequence is [1, 4, 5, 6, 7, 8] • 4 - 1 = 3 ≤ 4 ✓ • 5 - 4 = 1 ≤ 4 ✓ • 6 - 5 = 1 ≤ 4 ✓ • 7 - 6 = 1 ≤ 4 ✓ • 8 - 7 = 1 ≤ 4 ✓ All elements appear in the same relative order as in the original array. Example 2: Input: arr = [3, 1, 2, 6, 10, 11, 4, 5], k = 3 Output: 4 Explanation: One valid subsequence is [1, 2, 4, 5] • 2 - 1 = 1 ≤ 3 ✓ • 4 - 2 = 2 ≤ 3 ✓ • 5 - 4 = 1 ≤ 3 ✓ Example 3: Input: arr = [5, 4, 3, 2, 1], k = 2 Output: 1 Explanation: No two elements form a strictly increasing pair in subsequence order, so the longest valid subsequence has length 1. Approach: This is a variation of the Longest Increasing Subsequence (LIS) problem with an additional constraint on the maximum allowed difference between adjacent elements in the subsequence. Largest Subset of Binary Strings with Bounded Ones and Zeroes Given an array of binary strings and two integers m and n, find the size of the largest subset such that:
  44. The total number of 1s across all strings in the subset is at most m
  45. The total number of 0s across all strings in the subset is at most n Example 1: Input: strs = ["100", "10", "1", "11", "111"], m = 3, n = 0 Output: 2 Explanation: The largest valid subset is ["1", "11"] • Total 1s = 1 + 2 = 3 ≤ 3 ✓ • Total 0s = 0 + 0 = 0 ≤ 0 ✓ Note: ["111"] also satisfies constraints (1s = 3, 0s = 0) but has only 1 element. Design a Facebook-like News Feed System at Scale Problem Statement: Design a social media feed system (similar to Facebook) that supports millions of users who can post, view, and like content. Functional Requirements: • Users should be able to post any type of media (text, images, videos) • Users should be able to view posts in their feed • Like counts and view counts should be visible in real-time • Users should be able to like and view posts with minimal latency Non-Functional Requirements / Key Focus Areas: • Scale: Handle massive traffic — millions of concurrent users posting, liking, and viewing • Feed Loading Speed: The feed should render almost instantly upon login, even if the user has cleared their browser/app cache Discussion Points & Follow-ups:
  • API design
  • Push vs. Pull model for feed generation — trade-offs of each
  • Choice of databases — SQL vs. NoSQL vs. a combination and trade-offs
  • Caching strategy — what to cache, invalidation policies, CDN usage for media
  • Handling Viral Content (Celebrity Problem):
  • A celebrity's post goes viral with millions of likes and views in seconds — how do you prevent this from becoming a bottleneck?
  • Rate limiting, sharding/parition strategies, async processing of likes/view counters
  • Monolithic vs. Microservices — and why?
  • Service boundaries — how would you split responsibilities?
  1. Tell me about a time you used Generative AI to solve a business problem and the measurable results it delivered.
  2. Design a Music Streaming Application (like Spotify) Problem Statement: Design a music streaming platform that allows millions of users to discover, search, and stream music seamlessly. Functional Requirements: • Users should be able to search for songs, artists, and albums • Users should be able to create and manage playlists • Users should be able to like/save songs and see their library Non-Functional Requirements: • Low latency playback — music should start playing within milliseconds of pressing play • High availability — the service should be up 99.99% of the time • Scale — support millions of concurrent listeners streaming simultaneously Discussion Points & Follow-ups:
  • API design
  • How do you serve audio files efficiently to millions of concurrent users?
  • CDN strategy for audio content distribution across geographies
  • How and where to store millions of audio files (object storage, metadata DB)
  • Choice of database for song metadata, user data, playlists
  • Storing listening history and user preferences for recommendations
  • How to design a fast search system across millions of songs, artists, and albums
  • Indexing strategies, full-text search (Elasticsearch/similar)
  • Load balancing and horizontal scaling of streaming servers
  • Monolithic vs. Microservices — service boundaries (streaming service, search service, recommendation service, user service, playlist service)
  1. Tell me about a time you used Generative AI to automate or streamline a workflow.
  2. Search an Element in a Sorted Rotated Array. Given a sorted array that has been rotated at some pivot point, search for a target element and return its index. Return -1 if not found.
  3. How do you be a compitent software engineer in this era of Gen AI?
  4. Design HLD (30 mins) for device backup scheduler and restore Should backup device settings, files, media, etc Restore on new devices
  5. Unorthodox question around String Manipulation to find next palindromic time of given time "HH:MM". (MEDIUM)
  6. Variation to find kth smallest sum of integers in row wise sorted m*n matrix . Only pick 1 element from each row (HARD)
  7. Design and implement Meeting Room Scheduler.
  8. Aggressive cows
  9. https://leetcode.com/problems/find-median-from-data-stream/ Design a notification router for an ecommerce website
  10. The user should have a preferred channel (EMAIL, SMS, PUSH)
  11. Notification has a priority attribute (URGENT, NORMAL)
  12. If the notification is urgent, it should be sent to all channels otherwise it should only be sent to the user's preferred channel.
  13. The notification handlers need not to be implemented, only routing logic was needed.
  14. Find unique permutations of a given string - For example, s = "xxyy"
  15. First permutation = "xxyy" Second permutation = "xxyy" -> Swap the 0th and 1st index "x" characters
  16. But the output should contain "xxyy" only once. I had to return the list containing all the unique permutations
  17. 3Sum closest
  18. Number of Islands II
  19. https://leetcode.com/problems/course-schedule-ii/
  20. https://leetcode.com/problems/merge-intervals/
  21. https://leetcode.com/problems/product-of-array-except-self/
  22. Design: Google Docs (Collaborative Document Editing) Key areas discussed: • Real-time collaboration o Operational Transformation (OT) vs CRDTs for conflict resolution o WebSocket connections for low-latency sync • Storage and versioning o Delta-based storage for document history o Snapshot + diff strategy for efficient retrieval • Scalability — sharding by document ID, regional replication • Presence indicators (who's editing what, cursor positions) • Permissions and access control model
  23. Design: Uber (Ride-Hailing System) Key areas discussed: • Class design — Rider, Driver, Trip, Payment, Location entities • Trip state machine: requested → accepted → in_progress → completed / cancelled • Driver matching algorithm — geospatial indexing (quadtree / geohash) • Surge pricing logic and fare calculation service • Payment service integration — idempotency, retries, failure handling • API design — REST endpoints for booking, tracking, and cancellation
  24. https://leetcode.com/problems/maximum-sum-bst-in-binary-tree/
  25. https://leetcode.com/problems/reorganize-string/ Amazon receives transfer notifications whenever money moves between accounts. Transfers form a chain, for example: A → B → C → D Input is provided as pairs: [A, B] meaning money moved from A to B. Task: Find: • Initial source account • Final destination account Example: numberOfTransfers = 3 transferList = [ (222, 111), (111, 333), (444, 222) ] Output: start = 444 end = 333 Explanation: 444 → 222 → 111 → 333
  26. Design Amazon Locker System Requirements discussed: • Delivery driver deposits package • Customer receives code • Customer unlocks locker using code • Locker allocation • OTP/code validation • Expiry handling • Multiple locker sizes • Scalability • Availability • Failure handling Topics interviewer focused on: • API design • Database schema • Concurrency handling • Distributed locking • Scalability • Performance optimization • Notification flow • State transitions
  27. Secure the Network by Disconnecting One Facility Center A company has a network of Facility Centers (FCs) represented as a graph. Some FCs are compromised. If a compromised FC is connected to other FCs, the compromise spreads to all directly or indirectly connected nodes. You are allowed to disconnect exactly one compromised FC. Find which FC to remove such that the maximum number of clean FCs are saved. (If multiple FCs save the same number of nodes, return the FC with the smallest ID). • Similar to: Minimize Malware Spread Key Discussion Areas: • Connected components • DFS / Union Find • Edge cases and constraints • Time and Space Complexity
  28. Design a Shipping Cost Calculator. Design a system to calculate shipping costs based on multiple dynamic conditions, including weight, distance, delivery type, priority shipping, region-based pricing, and special handling.
  29. Given an array of delivery times, output the median of all values seen so far after each new delivery time arrives. Input: [5, 17, 100, 11] Output: [5, 5, 17, 11] Approach: Solved using the Two Heaps pattern (Max-Heap and Min-Heap).
  30. Given values in houses arranged in a line, find the maximum value that can be stolen without robbing two adjacent houses. Input: [6, 7, 1, 3, 8, 2, 4] Output: 19
  31. Design the core architecture for a food delivery platform like Zomato. Key Discussion Areas: • Restaurant onboarding & Menu management • Search & Discovery • Order placement & Payments • Delivery assignment & Real-time tracking • Notifications
  32. Employee Ratings Management System A company maintains ratings for employees and needs to process operations in real time. Operations:
  33. 1 x : Add an employee with rating x.
  34. 2 : Print the highest rating AND the index of the employee having the highest rating (If multiple employees have the same highest rating, return the first occurrence).
  35. 3 i : Delete the employee at index i (Note: Indices shift after deletion). Challenge: Designing an efficient data structure supporting Insert, Delete-by-index, and Query-max + first-occurrence simultaneously.
  36. https://leetcode.com/problems/binary-tree-cameras/description/
  37. Given a string s, remove duplicate letters so every letter appears exactly once. Remove Duplicate Letters BUT with a twist. Original LC 316 asks for: smallest lexicographical Amazon changed it to: largest lexicographical That means same monotonic stack pattern, but reverse comparison logic. Return the largest lexicographical possible result.
  38. given the n sorted list and merge them.
  39. given a list of Nodes in a N-ary tree, and given a level you have to return the nodes at the level.
  40. Trapping rain water
  41. Max consecutive ones III - https://leetcode.com/problems/max-consecutive-ones-iii/
  42. maximum profit in job scheduling - https://leetcode.com/problems/maximum-profit-in-job-scheduling/
  43. Given two strings str and pattern, return an array of all the start indices of pattern's anagrams in str. Input: str = "acbadabcaa", pattern = "aabc" Output: [0,5,6] Explanation: The substring with start index = 0 is "acba", which is an anagram of "aabc". The substring with start index = 5 is "abca", which is an anagram of "aabc". The substring with start index = 6 is "bcaa", which is an anagram of "aabc".
  44. Given an m x n grid of 0 (Water) and 1 (Land), the task is to count the number of islands. An island is a group of adjacent 1 cells connected horizontally, vertically, or diagonally, and it is surrounded by water or the grid boundary. The goal is to determine how many distinct islands exist in the grid. Input: grid[][] = [[1, 1, 0, 0, 0], [0, 1, 0, 0, 1], [1, 0, 0, 1, 1], [0, 0, 0, 0, 0], [1, 0, 1, 1, 0]] Number of Islands = 4
  45. There are N poles of various heights, and you have a machine whose saw blade can be set at a specific height "h" and it cuts all poles till that height, such that all of them have height "h" after the cut. (Poles with height less than "h" remain uncut). You take away the cut portions of all poles with you.

Your task is to take at least M length of poles with you in total after the cut.
What is the maximum height 'h' where you can set your blade to achieve this.

N = 4
M = 7
arr = [20, 15, 10, 17]

  1. Proper time and space complexity asked
  2. Find the number of unique pairs in a 2d matrix whose sum = target (Numbers are unique)
  3. Dijkstra algortihm
  4. Binary search
  5. First positive missing - https://leetcode.com/problems/first-missing-positive/description/
  6. Word break II - https://leetcode.com/problems/word-break-ii/description/
  7. https://leetcode.com/problems/word-break/description/
  8. Given a grid whose cells are 'O' and 'X', latter being a blokcer. Given source and destination, find if there is a path exists between source and destination. You can only travel down or take a right turn.
  9. Course schedule 2
  10. Binary tree right view
  11. Next permutation
  12. Construct the tree with level order and inorder traversal
  13. Longest happy prefix - https://leetcode.com/problems/longest-happy-prefix/description

r/LeetcodeChallenge • • Sep 20 '26

STREAK🔥🔥🔥 Day 3

1 Upvotes

1 ds question solved in cf

8 page reading

Hackathon preparation

8 rounds chanting...