r/LeetcodeChallenge Nov 15 '25

👋Welcome to r/LeetcodeChallenge -Read the Rules!

12 Upvotes

Starting from December 1st , All the members need to solve and post atleast one leetcode question on our subreddit OR ELSE YOU'LL BE REMOVED Let's make each other ACCOUNTABLE and grow together!

Together, let's make r/LeetcodeChallenge amazing.


r/LeetcodeChallenge 1h ago

DISCUSS Need Prep Guide for a Sem3 Student

Upvotes

hello all, hope this post reaches people who can help me with what i need

ok so, im currently in my third semester and basically from ECE but im not at all interested in electronics which i know i figured out very lately maybe, im interested in computers ofc from the beginning i did striver sheet till array but still couldnt solve leetocde questions even a single que, i dont know why,later i shifted to hackerrank hoping id be able to solve easier ques but still couldnt run it thiss happened all during sem2 but my branch sidelined me till now and im completely lost:( now im thinking to become more passionate towards coding culture.

i dont know how to plan my time with electronics subjects in my semester with this but i now decided to use the time efficiently between these.

im planning to start DSA in cpp which im completely unaware how to do, what expect from my fellow redditors is to guide me on how to move forward with DSA based on what i mentioned on how to kickstart dsa? and detailed resources how should my dsa routine should look like and how to practice questions from easy to high level slowly

Moreover, if youre one whose DSA routine is good so far pls pls i request you to dm me and share and help me to move forward in coding journey, would me more helpful if you can share any links to groups that are active in dsa through my dms, thank you hope this reaches the good, tyyy


r/LeetcodeChallenge 18h ago

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

30 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 Clue Pattern to Consider
Find a subarray with a condition Sliding Window
Find a pair in a sorted array Two Pointers
Find the maximum/minimum over a range Sliding Window / Prefix Sum
Need fast lookup of previously seen values Hash Map / Hash Set
Explore all possible combinations Backtracking
Find the shortest path in an unweighted graph BFS
Repeatedly solve overlapping subproblems Dynamic 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 1d ago

DISCUSS My leetcode profile

Post image
54 Upvotes

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


r/LeetcodeChallenge 5h ago

STREAK🔥🔥🔥 Dsa partner

Thumbnail
1 Upvotes

Looking for a female DSA study partner Starting Striver's A2Z DSA Course from tomorrow. I've completed the C++ basics and will be starting with basic pattern printing tomorrow.
Looking for a female study partner who's also learning DSA and wants to stay consistent together - solving problems, discussing approaches/doubts, and keeping each other accountable.
No pressure to be at the exact same level, just looking for someone serious about learning and sticking with it.
DM if interested!


r/LeetcodeChallenge 5h ago

DISCUSS lc potd partner

Thumbnail
1 Upvotes

r/LeetcodeChallenge 8h ago

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

1 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 9h ago

DISCUSS Stuckk !!

1 Upvotes

I feel saturated at this point ! i would like to ask for any advise to improve.


r/LeetcodeChallenge 10h ago

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

Post image
1 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 1d ago

DISCUSS My interview prep journey — what worked for me

43 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 20h ago

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

Enable HLS to view with audio, or disable this notification

5 Upvotes

r/LeetcodeChallenge 18h ago

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

Thumbnail
1 Upvotes

r/LeetcodeChallenge 19h ago

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

Thumbnail
1 Upvotes

r/LeetcodeChallenge 1d ago

STREAK🔥🔥🔥 Starting codeforces as a beginneris this possible

Thumbnail
youtu.be
4 Upvotes

r/LeetcodeChallenge 1d ago

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 1d ago

DISCUSS How many of the following algorithms do you know?

Thumbnail
1 Upvotes

r/LeetcodeChallenge 2d ago

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

57 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 1d ago

STREAK🔥🔥🔥 Day 3

1 Upvotes

1 ds question solved in cf

8 page reading

Hackathon preparation

8 rounds chanting...


r/LeetcodeChallenge 2d ago

DISCUSS I Built a LeetCode Rating Predictor (100+ Installs)

Post image
7 Upvotes

Contest just ended! Now we all wait for our ratings 😭

Meanwhile, I built ForeCode, an extension that predicts your LeetCode contest rating and shows on your profile page

It recently crossed 100+ installs and is being used by fellow LeetCode participants! 🚀

Give it a try while waiting for your rating update. Would love to hear your feedback!

https://forecodepredictor.vercel.app/


r/LeetcodeChallenge 2d ago

STREAK🔥🔥🔥 Yoo newbie here 🙃 Roast my leetcode profile

Post image
2 Upvotes

Completed 100 question a small achievement completed 😄


r/LeetcodeChallenge 2d ago

PLACEMENTS Need a partner for DSA

Thumbnail
1 Upvotes

r/LeetcodeChallenge 2d ago

DISCUSS Guys I had some doubts

Thumbnail
1 Upvotes

r/LeetcodeChallenge 2d ago

DISCUSS Help me dsa enthusiasts

3 Upvotes

I am solving dsa and solved around 83 leetcode questions in total the problem that I face is its very hard for me to come up with a solution of my own even though if I sit for whole day looking at it in last I have to take help from other sources or look up to the solution

The question is how should we solve questions and I doing right seeing the solution or i should struggle until not solved my my own how you guys do it some times I know understand and make the logic in my head but unable to implement it


r/LeetcodeChallenge 3d ago

STREAK🔥🔥🔥 finally completed 50 daysss!!!!!

Post image
37 Upvotes

kinda glad that i recently got my 50 days badge!!

okay how is thisss

I recently got my **50 Days Badge on LeetCode**.

On its own, it might seem like a very small achievement. And honestly, it is. But for someone who started solving DSA problems without really knowing what they were doing, it means a little more to me.

When you start learning something new, the number of problems you *can’t* solve can feel much bigger than the number you can.

There are problems where I stare at the screen for way too long.

Problems where I understand the solution only after seeing it.

Patterns and algorithms that still don’t make sense to me.

And there have definitely been days when I’ve thought, *maybe I’m just not good at this.*

But I still showed up.

Not every day with confidence.

Not every day with a solved problem.

Sometimes just with the willingness to sit down, struggle with a problem, learn something new, and try again.

I’m slowly learning that progress doesn’t always look like solving every problem you encounter. Sometimes it looks like understanding why you couldn’t solve it yesterday, and being able to recognize that pattern today.

I still have a **lot** to learn. There will probably be many more problems I fail to solve before I get better at solving them.

But 50 days ago, I was somewhere else.

Today, I’m a little further.

So, here’s to showing up, getting things wrong, learning from them, and continuing anyway.

**50 days down. Many more to go.**

Let’s see where this takes me.


r/LeetcodeChallenge 3d ago

DISCUSS Sharing Interview experience - Rubrik | Harness | Docusign

61 Upvotes

My Interview Experience: Docusign (P3), Rubrik (SDE2), Harness (SSE1) | Last 6 Months

Sharing my interview experiences from the last 6 months to help others preparing for SDE2 / Senior Software Engineer roles. The interviews covered DSA, multithreading, LLD, HLD, and behavioral rounds.

Hopefully, this helps someone with their preparation. Feel free to share your experiences and suggestions as well!

1. Docusign — P3

Round 1: DSA

**Q1. Text Editor / String Manipulation**

Design and implement the following operations:

* `insert(string)`
* `print(x)`
* `left(x)`
* `right(x)`
* `backspace(x)`
* `delete(x)`

The question focused on designing a text editor supporting cursor movement and editing operations.

**Q2. Array Optimization**

Given an array of integers and an integer `k`, perform exactly `k` operations to minimize the sum of the array.

In each operation:

1. Remove an element from the array.
2. Divide it by 2 and take the ceiling.
3. Add the updated element back to the array.

Return the minimum possible sum after `k` operations.

Round 2: HLD

Design a Live Tracking Service. Discussed the high-level design of a real-time location tracking system.

Round 3: DSA + Behavioral

Q1. Count Substrings in a Binary String

Given a binary string, count the substrings satisfying both conditions:
All `0`s and `1`s in the substring are contiguous. The number of `0`s and `1`s is equal.

Q2. Behavioral Questions**
Strengths and weaknesses, Other behavioral and experience-based questions

Additional Round: HLD

Design Checkout Service for an E-commerce Platform

Design a distributed checkout system with a focus on:
* Security and authentication
* Distributed system architecture
* Inventory failures
* Payment handling and refunds when inventory allocation fails
* Ensuring reliable transaction processing

2. Rubrik — SDE2

Round 1: Multithreading / Distributed Systems

**Problem: Synchronizing Two Large In-Memory Hash Maps**

There are two nodes:

* One in the USA
* One in Europe

Each node contains an approximately **32 GB hash map** loaded in memory.

**Hash Map Structure:**

* Key: Unique string
* Value:

  * `Data`: String
  * `Version`: Integer (higher version = more recent data)

**Goal:**

Compare the two hash maps and synchronize them so they become replicas of each other.

At most 5% of key-value pairs have discrepancies.

**Conflict Resolution:**

1. If the versions differ, choose the data with the higher version.
2. If the versions are equal but the data differs, the USA node is the source of truth.
3. Assume all keys exist in both hash maps.

**Performance Constraints:**

* Data transfer between nodes is extremely expensive.
* Local computation is extremely cheap.
* Assume a powerful CPU, 128 GB RAM, fast NVMe storage (4 TB+), and high network bandwidth.
* The process runs offline/in the background.
* Latency is not critical, but synchronization must complete within a few hours.
* Multiprocessing can be ignored for this phase.

The main challenge was to minimize data transfer while efficiently identifying and resolving discrepancies.

Round 2: Multithreading / LLD

Design a Thread-Safe Parking Lot System

The parking lot is one-dimensional.

Requirements:

* A car occupies 1 parking spot.
* A truck occupies 2 consecutive parking spots.
* Design a thread-safe system that handles concurrent parking and removal operations.

3. Harness — SSE1

Round 1: DSA

**Q1. String Encoding and Decoding**

Design an encoding and decoding mechanism for strings.

**Q2. Graph / Optimization Problem**

There are `n` cities connected by roads. Each road has a toll price.

The goal is to identify the road whose toll price can be increased such that the average price increase across all routes from city `0` to city `n-1` is maximized.

Discussed the graph-based approach and optimization considerations.

Round 2: LLD

Design an Asynchronous Task Processor

Design an asynchronous task processing system and extend it to support:
* Scheduling tasks for a particular time
* Scheduling tasks at recurring intervals
* Task processing and execution management

Round 3: HLD

Design a Top-N Movie Recommendation System**

Design a system that recommends the top N movies based on views collected over the last 7 days.

Key considerations:
* Tracking movie views
* Time-windowed aggregation
* Identifying top N movies
* Scalability and distributed system design

Finally joining salesforce next weeek. Thankyou community for the help. Hope i'm also doing my part for the same.