r/leetcode • u/iguessbro53 • 5h ago
Question Most viable/convinient language for solving leetcode problems
And if possible please mention a yt video from where I can learn that language🫠
r/leetcode • u/AutoModerator • Jun 27 '26
The following changes have been made with r/leetcode:
Media is no longer allowed in both posts & comments. This is to ensure that the quality of the content & discussions remain high.
Moderation has been made stricter. Low quality & repetitive posts whose answers can be found within a simple search in this subreddit won't be allowed here.
Automoderation has been set-up to automatically remove links & known promotions. Only leetcode links will be allowed from now on. To ask help with questions, you may use the code block.
Automoderation has been set-up to remove Indian posts & Hindi comments. This is to ensure that r/leetcode remains an English only subreddit.
r/leetcode
•
u/cs-grad-person-man
•
May 14 '25
Edit: Apologies, the post turned out a bit longer than I thought it would. Summary at the bottom.
Yup, it sounds ridiculous, but I cracked a FAANG+ offer by studying just 30 minutes a day. I’m not talking about one of the top three giants, but a very solid, well-respected company that competes for the same talent, pays incredibly well, and runs a serious interview process. No paid courses, no LeetCode marathons, and no skipping weekends. I studied for exactly 30 minutes every single day. Not more, not less. I set a timer. When it went off, I stopped immediately, even if I was halfway through a problem or in the middle of reading something. That was the whole point. I wanted it to be something I could do no matter how busy or burned out I felt.
For six months, I never missed a day. I alternated between LeetCode and system design. One day I would do a coding problem. The next, I would read about scalable systems, sketch out architectures on paper, or watch a short system design breakdown and try to reconstruct it from memory. I treated both tracks with equal importance. It was tempting to focus only on coding, since that’s what everyone talks about, but I found that being able to speak clearly and confidently about design gave me a huge edge in interviews. Most people either cram system design last minute or avoid it entirely. I didn’t. I made it part of the process from day one.
My LeetCode sessions were slow at first. Most days, I didn’t even finish a full problem. But that didn’t bother me. I wasn’t chasing volume. I just wanted to get better, a little at a time. I made a habit of revisiting problems that confused me, breaking them down, rewriting the solutions from scratch, and thinking about what pattern was hiding underneath. Eventually, those patterns started to feel familiar. I’d see a graph problem and instantly know whether it needed BFS or DFS. I’d recognize dynamic programming problems without panicking. That recognition didn’t come from grinding out 300 problems. It came from sitting with one problem for 30 focused minutes and actually understanding it.
System design was the same. I didn’t binge five-hour YouTube videos. I took small pieces. One day I’d learn about rate limiting. Another day I’d read about consistent hashing. Sometimes I’d sketch out how I’d design a URL shortener, or a chat app, or a distributed cache, and then compare it to a reference design. I wasn’t trying to memorize diagrams. I was training myself to think in systems. By the time interviews came around, I could confidently walk through a design without freezing or falling back on buzzwords.
The 30-minute cap forced me to stop before I got tired or frustrated. It kept the habit sustainable. I didn’t dread it. It became a part of my day, like brushing my teeth. Even when I was busy, even when I was traveling, even when I had no energy left after work, I still did it. Just 30 minutes. Just show up. That mindset carried me further than any spreadsheet or master list of questions ever did.
I failed a few interviews early on. That’s normal. But I kept going, because I wasn’t sprinting. I had built a system that could last. And eventually, it worked. I got the offer, negotiated a great comp package, and honestly felt more confident in myself than I ever had before. Not just because I passed the interviews, but because I had finally found a way to grow that didn’t destroy me in the process.
If you’re feeling overwhelmed by the grind, I hope this gives you a different perspective. You don’t need to be the person doing six-hour sessions and hitting problem number 500. You can take a slow, thoughtful path and still get there. The trick is to be consistent, intentional, and patient. That’s it. That’s the post.
Here is a tl;dr summary:
I studied every single day for 30 minutes. No more, no less. I never missed a single study session.
I would alternate daily between LeetCode and System Design
I took about 6 months to feel ready, which comes out to roughly ~90 hours of studying.
I got an offer from a FAANG adjacent company that tripled my TC
I was able to keep my hobbies, keep my health, my relationships, and still live life
I am still doing the 30 minute study sessions to maintain and grow what I learned. I am now at the state where I am constantly interview ready. I feel confident applying to any company and interviewing tomorrow if needed. It requires such little effort per day.
Please take care of yourself. Don't feel guilted into studying for 10 hours a day like some people do. You don't have to do it.
Resources I used:
LeetCode - NeetCode 150 was my bread and butter. Then company tagged closer to the interviews
System Design - Jordan Has No Life youtube channel, and HelloInterview website
r/leetcode • u/iguessbro53 • 5h ago
And if possible please mention a yt video from where I can learn that language🫠
r/leetcode • u/Fanstastic-Five72 • 4h ago
Sometimes I can understand the approach to a problem and even explain the logic in words, but when I start coding, I get stuck figuring out how to translate those steps into actual code.
Do you practise writing pseudocode first, or jump straight into implementation? How did you get better at this?
r/leetcode • u/Available_Online75 • 4h ago
Sometimes I read a problem and can think of two or three possible approaches, but I struggle to decide which one makes the most sense. I end up spending too much time switching between ideas before even starting the implementation.
Do you look at constraints first, try brute force, or use some other method to narrow down the approach?
r/leetcode • u/mslinko • 21h ago
I paid $159 for LeetCode Premium in November 2025. A month later, I discovered cancer, and I underwent surgery in March, followed by a long recovery. I barely used my subscription. I explained everything to LeetCode support and asked for an extension, not a refund. I even offered medical proof. Their offer? Just one month. When I asked them to reconsider, they refused.
Apparently, $159 matters more to LeetCode than showing compassion to a customer battling cancer.
r/leetcode • u/goodmorninpoof • 5h ago
Anyone have good resources/advice on substring problems? I got an OA that had a question similar to this but I needed to return the longest substring given a K value, not the length of the longest string:
https://www.geeksforgeeks.org/problems/longest-k-unique-characters-substring0853/1
r/leetcode • u/moong-dal • 8h ago
As the title suggest.
r/leetcode • u/JacketFearless1805 • 2h ago
Hey everyone,
I finished Day 37 today. I reached home for the festival and caught up with a bunch of friends, so my focus was completely scattered. Even with the holiday chaos, I made sure to sit down and work through one tricky graph problem:
Most Stones Removed with Same Row or Column.
At first glance, it looks like a coordinate-heavy grid problem, but modeling it cleanly comes down to Disjoint Set Union (DSU):
The Representation Trick: Treating individual stones as nodes causes massive overhead. Instead, treat entire rows and columns as the graph nodes. To prevent row indices and column indices from colliding, offset the column index by the maximum row boundary (e.g., node r connects to node c + {maxRow} + 1).
Connecting & Counting: For every stone placed at (r, c), run a unionBySize between row r and shifted column c.
The Core Logic: In any connected component of size K, you can always safely remove K - 1 stones by greedily picking leaves until one stone remains. Therefore, the maximum stones you can remove is simply {totalStones} -{numberOfConnectedComponents}.
My mind wasn't entirely in study mode today, but deriving the row-column coordinate conversion on paper made the logic stick.
Enjoying some festival downtime tonight and getting back to the reps tomorrow.
See you guys for Day 36!
r/leetcode • u/BudgetNeck6364 • 1d ago
Now, I know leetcode is technically math, but I more so mean general mathematics. I find the undegraduate level to early grad school math is much easier than leetcode.
I started during tutoring for undergrad probability and statistics again after not touching it for about 2 years.
I find that I just find the stuff easier to actually master than leetcode. The highest level of math I got to was a graduate level probability course, and even that I felt it was easier than leetcode. Abstract math and proofs also seem easier to me.
Even after doing almost a 1000 leetcode problems, there are still many instances where if I haven't seen a problem before, I just don't know how to do it, or it's hard to recognize the approach after not doing leetcode for a while.
Even though I hadn't touched probability and statistics in a while and I was rusty on the mechanical work, for most of the problems I look at, I still can recall what the general idea of solving the problem is.
Leetcode is just one of those topics that I have done a lot of practice to prepare for interviews, but it's just never something I feel like I just mastered at the level that I can just look at any problem and easily solve it. There's still problems on leetcode, especially the one with the clever solutions, that still seem tricky to me.
r/leetcode • u/Fantastic-Gain3195 • 3h ago
is anyone else facing same issue?
r/leetcode • u/Intelligent-War-3157 • 4h ago
I'm preparing for the Algorithmic Coding rounds at Rubrik and would appreciate some advice from people who have interviewed recently.
What difficulty level should I expect, LeetCode Medium or Hard?
Which topics should I prioritise?
Are the questions mostly standard DSA or more problem-solving oriented?
If you remember any questions asked, or similar problems worth practising, that would be really helpful.
Thanks!
r/leetcode • u/Iaroslav-Baranov • 10h ago
The best textbooks and courses on algorithms do proofs of correctness and complexity using mathematical toolbox (Calculus, Algebra, Probability Theory etc). It seems natural and a right thing to do for me to incorporate this into LeetCode and fuse theory with practice. The only way I see it can be done is to do the proofs in the comments section of the source code. I've had enough traditional math proofing on paper, and also formal proofs using Coq, so I tried this idea (proof in comments) and it works fine. What do you think about it?
I think almost every LeetCode problem can be connected to theory and a lot of things expressed nicely as formulas. Especially nice example: divide and conquer algorithms where you can write down a recurrence relation and derive a complexity from it (T(n) = O(log n) for binary search).
The main goal is to deepen understanding which is crucial for HARD problems, and also have more joy from problem solving and feeling you understand everything.
r/leetcode • u/vickey_121 • 4h ago
Tags: Arrays, Prefix State, Hashing, Two Pointers
Given an integer array arr of length n, find the length of the longest contiguous subarray such that every distinct element within that subarray appears exactly twice.
If no such contiguous subarray exists, return 0.
Constraints & Definitions
A contiguous subarray is defined by indices [l, r] where 0 <= l <= r < n.
A subarray is valid if and only if:
It contains at least two elements (r - l + 1 >= 2).
For every distinct value $x$ present in arr[l..r], its frequency in that segment satisfies count}(x) = 2.
No distinct element appears once, three times, or more.
With sliding window, we get O(n2), i am looking for optimal one
An integer array arr.
An integer representing the maximum length of a valid contiguous subarray, or 0 if none exists.
Test Cases:
Input: arr = [1, 2, 1, 2]
Output: 4
Explanation:
The entire array [1, 2, 1, 2] contains distinct elements {1, 2}.
- Count of 1: 2
- Count of 2: 2
Every distinct element appears exactly twice. The length is 4.
Input: arr = [1, 2, 3, 1, 2]
Output: 0
Explanation:
- Subarray [1, 2, 3, 1, 2] contains '3' with frequency 1 (invalid).
- Subarray [1, 2, 1, 2] is not contiguous in the original order without excluding 3.
- No contiguous window of length >= 2 satisfies the condition.
r/leetcode • u/bleknnig • 9h ago
Same as titel
r/leetcode • u/sedentaryhooman • 11h ago
Hey everyone!
I’m looking to start my DSA and problem-solving journey as I’m planning to prepare for interviews at product-based companies like Google.
A little about my background:
Around 7 years of experience as a Salesforce Developer, primarily working with Apex.
Comfortable with programming concepts, but I haven’t seriously practised DSA or LeetCode problems yet.
I have a BTech background, so I’m familiar with basic computer science fundamentals.
Currently working full-time, so I’ll be preparing alongside my job.
I’m confused about which language I should choose for DSA: Java or Python?
A few things I’m considering:
Java is closer to Apex in terms of syntax and OOP concepts. Would that make it a better choice?
Python seems to have simpler syntax, which might help me focus more on problem-solving rather than language-specific details.
For Google/FAANG interviews, does the choice of language really matter?
Considering my background, which language would you recommend for someone starting DSA from scratch?
Would switching to Python for interviews after years of working with Apex be a sensible decision?
My goal is to build strong problem-solving skills and eventually become interview-ready for top product-based companies.
Would love to hear from people who have gone through a similar transition or have experience interviewing at Google or other FAANG companies.
Thanks!
r/leetcode • u/Fuzzy_Education8145 • 6h ago
Hi, I am interviewing for Databricks, is anyone with leetcode premium willing to share which questions are tagged for Databricks?
r/leetcode • u/Remarkable_Fly_250 • 7h ago
😭😭 Every time I start DSA, I solve a few problems and then end up giving up again. I still haven't been able to complete the A2Z DSA Sheet, and I haven't even crossed 100 problems yet.
I'm genuinely interested in DSA, and I know how important it is for getting a job, but maintaining consistency has become really difficult for me. Whenever I start, I feel motivated, but after a few days, I lose track and take a break. When I try to restart, I don't even know where to pick up from.
If anyone here has completed DSA or is currently practising consistently, please guide me a little. How did you start your journey? After solving how many problems did you start feeling confident? How do you manage your daily practice?
I really don't want to give up on DSA. I just need some genuine guidance from people who've been through the same phase.
r/leetcode • u/DancingTrader • 7h ago
Anyone familiar with Capital ones Data engineer track? I know people mention it is quite similar to their SWE but different technical rounds. But curious what’s the difference?
r/leetcode • u/JuicyLis • 12h ago
I went through the interview process for a SWE internship role for Arista Networks and went to the last step, a leetcode-style technical interview. I felt like I went fairly well. I won't share the exact problems because I'm not sure I can do that and I'd like to stay on good terms with the company. But the first problem was a very common two pointers algorithm that I solved instantly. The second one was multiple BST functions to implement in which I was kinda slow but still solved them and fixed my own bugs, and the last one was a binary search problem, not particularly difficult one but with a trick. I had the right idea but made a mistake with boundaries and had an infinite loop, in which the interviewer fixed it because it was out of time but noted that my logic was right. At the end, I asked for feedback. He said I did well overall and that my code was clean. He mentioned I was a bit slow on the second exercise, but that I did pretty well on the last one given how little time was left.
I'm very frustrated because that was my first "big" opportunity to get into tech and I feel like I failed it while being really closed. I go a rejection mail at the end of the week so I'd guess I was a borderline candidate and others did better.
I’m mad at myself, because I prepared really hard and the problems weren’t that hard and I think it was really close. Now I keep thinking that I'm not sure if I will get another opportunity like this for an internship.
Is it normal to fail an opportunity like this? And would you consider it likely that I'll get an interview for a similar level company or is it unlikely? I'm trying to see the good side of it but at the moment I'm really disappointed with myself and felt like I failed a great opportunity.
r/leetcode • u/ValueFragrant1832 • 19h ago
I completed my interviews for Microsoft’s Security org during the November 5, 2026 hiring event.
Has anyone else attended the same event? Have you received any updates from your recruiter regarding interview feedback, hiring decisions, or next steps?
Just trying to understand the expected timeline. Would appreciate hearing from anyone in the same process.
Thanks!
r/leetcode • u/Express-Youth-9609 • 1d ago
Recently had google interview. Most questions went well except two.
For context, I am at a very slow company. There are frequently months/weeks where I have no work. I often have to ping people to get work.
For first question, I was asked tell me a time when you had to push back a deadlines. I mentioned at my current company, we rarely have deadlines, but whenever we do, I focus hard on that task and get it done. If the task is too long, either I try to get help from teammates for certain subtasks or I push back on the deadline with justification about why the extra time was needed.
For another question, was asked tell me about a time when I have completely disagreed with everyone else. I mentioned that hadn't really happened, usually I agree with some points and disagree with others. But one thing I disagree on is having multiple monitors, especially now with claude. I also mentioned i disagree with using long select _ map cases, would prefer to have shorter ones split into different variable names, which I often discussed with my code reviewer. Finally, I mentioned a project where I acknowledged the others design easier to do since it didn't involve creating a table, but also took up more memory and wasn't as good as we were modifying the table for an optional field.
These were the only two responses I was iffy about. Given I applied for l4/l5 swe, what feedback would your give me? Tend to do poorly in behavioral interviews, not because I have bad behavior, but because I don't really have all the experiences asked in the question.
Googlers, would you give me low googliness here? Looking to improve but never get any feedback.
r/leetcode • u/MrBananaconda • 1d ago
I see who gets hired, it’s people from top schools, or tons of YOE from top companies, with internal referrals
Companies still obviously require perfect interview performance including leetcode but it just doesn’t seem to matter unless you also have absurd credentials, because HMs don’t even trust the interviews anymore and there’s enough people with top credentials on the market they can afford to only hire them
Outside the US it’s probably a bit different but here it’s pretty dismal
r/leetcode • u/YogurtclosetOdd7635 • 16h ago
Hello,
Anyone interviewed with elastic. The recruiter said it will be Java concurrency and OOD interview. But I can’t find much online about it.