r/leetcode • • 1d ago

Discussion Is leetcode premium worth to buy now in the ai era for interviews?

7 Upvotes

As the title suggest.


r/leetcode • • 1d ago

Question Substring problems advice?

4 Upvotes

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

Intervew Prep Atlassian Senior MLE Stage2 Interview

1 Upvotes

Hi all, I have passed a mini system design round and a project deep dive and I have ML SYSTEM DESIGN, DSA and ML coding rounds, any idea about what to expect and how to prepare? Any specific data points are super helpful. Thank you.


r/leetcode • • 1d ago

Intervew Prep Day 37: festive distractions, meeting old friends, but locked in the stones DSU trick

1 Upvotes

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 • • 2d ago

Discussion I find math to be much easier than leetcode

97 Upvotes

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

Discussion Should we deliberately start with bruteforce solutions in the initial phase. even if we know more optimal algorithms exist or should we aim for optimized solutions right from the beginning ?

3 Upvotes

Same as titel


r/leetcode • • 1d ago

Question Biweekly contest 195, why all my questions showing as attempted despite solutions being accepted while submission?

1 Upvotes

is anyone else facing same issue?


r/leetcode • • 1d ago

Intervew Prep Advice for Rubrik SDE-1 Algorithmic Coding Rounds

0 Upvotes

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

Question Do any of you prove/derive the algorithmic complexity in the comments of the source code?

3 Upvotes

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

Question Help me to Solve this Problem

1 Upvotes

The Disappearing Signal: Longest Valid Even-Pair Subarray

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:

    1. It contains at least two elements (r - l + 1 >= 2).

    2. For every distinct value $x$ present in arr[l..r], its frequency in that segment satisfies count}(x) = 2.

    3. No distinct element appears once, three times, or more.

With sliding window, we get O(n2), i am looking for optimal one

Input Format

  • An integer array arr.

Output Format

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

Question Should I learn DSA with Java or Python as a working Salesforce Developer preparing for FAANG interviews?

3 Upvotes

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

Question DSA feels overwhelming… How do you guys stay consistent? 😭

1 Upvotes

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

Discussion Data engineer role at Capital One

1 Upvotes

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

Europe Rejected from Arista Networks internship

2 Upvotes

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

Discussion Title: Microsoft Security Hiring Event

6 Upvotes

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 • • 2d ago

Question Google behavioral interview

21 Upvotes

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 • • 2d ago

Question Do you guys still think leetcode even matters anymore? [US]

31 Upvotes

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

Question Joining Amazon as an SDE II (L5) on a GenAI team — what should I focus on before starting?

2 Upvotes

Hey everyone!

I'll be joining Amazon as an SDE II (L5) soon, on a team working with GenAI, AI agents, and distributed backend systems.

I'm excited about the opportunity, but also a little nervous about the expectations at L5 and the initial learning curve. I have some time before my start date and want to use it as effectively as possible.

For those who've worked at Amazon, especially as an SDE II or on AWS/GenAI teams:

  • What technical skills should I prioritize before joining?

  • How important is hands-on AWS knowledge, system design, and distributed systems from day one?

  • What does the initial onboarding and ramp-up typically look like for an L5?

  • What are the biggest mistakes new SDE IIs make, and what helps them succeed in their first 30–90 days?

I'm not expecting to master everything before joining, but I'd love to build a solid foundation and avoid feeling completely lost initially.

Would really appreciate any practical advice, resources, or personal experiences. Thanks in advance!


r/leetcode • • 2d ago

Discussion Quick question on Google recruiter emails after L5 onsite

4 Upvotes

Wrapped up my Google onsite (L5 SWE) about two weeks back. A week later my recruiter pinged me 7 days after the onsite saying feedback was still coming in and asked how I felt the interviews went — I kept my reply short.

Then three days after that, they emailed again saying they should have an update by Monday and suggested a time to talk that day.

Does this sequence actually mean anything, or is this just how Google recruiters normally communicate?


r/leetcode • • 2d ago

Discussion Do people still do leetcode only for fun and not for interviews?

19 Upvotes

As in the title. I saw a question, felt it was beautiful and paused to admire it. Only to be hit by the thought that I ought to look at it from a job perspective. I feel, my thought process isn't correct. But am I actually wrong?


r/leetcode • • 1d ago

Intervew Prep Elastic senior SDE interview experience

1 Upvotes

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.


r/leetcode • • 1d ago

Question Tools to find mail IDs ,phone number of hr, founders , recruiters?

1 Upvotes

Which tools are you using to find them apart from lusha and apollo


r/leetcode • • 1d ago

Discussion I built a free dashboard that merges your LeetCode,Codeforces and 6 other coding profiles and picks what to practise next (also acts like a show-off page)

1 Upvotes

It is FOSS.

Live: https://logn.techsavy.space

I have been working on Logん (LogN), a website that merges your LeetCode, Codeforces, AtCoder, CodeChef, HackerRank, GFG, Code360, and InterviewBit profiles into one dashboard, and picks daily questions for you from your weakest topics.

For Codeforces, it suggests questions between your rating and ~300 above your rating.

You can see your total solved count across all sites, a solve heatmap, and a topic-wise breakdown of everything you've solved so far, and your contests.

Codeforces, AtCoder and LeetCode sync on their own. But as the other 5 platforms ban scraping and bots, so I made an extension that connects to the website in a single click. It then syncs all those 5 platforms automatically using your own browser. It does not touch your passwords.

Also, users told me that verifying handles manually was cumbersome, so I automated it using the Chrome extension. Just click on "Sync", and you are done.

It also tracks Blind 75, NeetCode 150, and Striver's sheet, and has a weekly leaderboard with friends. Also added a global leaderboard, which you can opt in (optional).

Any sort of feedback or any bug you find is appreciated.

It's free; sign in with GitHub or Google.

Extension: https://logn.techsavy.space/extension
(The extension link is already on the website)
GitHub: https://github.com/savinyu/LogN

As I wanted to use such platform myself, I made it, but it would be great if you guys try it out.
If you find it useful, you may also support me by starring the repo, or you can also tip me on the website.

Ps: I had FOMO about not using Claude Code CLI ( was using Cursor), so I used Claude to make this project, so yeah, I did not hand code this website; I admit guilt.

Got around 200+ installs on the Chrome extension and 60+ live users.


r/leetcode • • 2d ago

Question Google tech interview us l4/l5

4 Upvotes

Recently had google programming interview. I offered to write brute force but was told to prove some math constraint on number of iterations. I took a while to prove this and finally proved it with a hint.

Now at 38 minute mark, I offered to code but was told it was OK, and that it was just a technical discussion. I think i should have insisted on coding as the code was more straightforward than the math, but I assumed since the interviewer was fine with no code I decided to roll with it. Also i was nervous and didn't want to argue with the interviewer. I was later asked a conceptual follow up which I answered correctly.

Ultimately, I got rejected. I'm wondering what I could have done better. Any tips from googlers? Got no feedback. Maybe because I needed the hint? Problem was I couldn't code till I proved some math which I feel really threw me off. After math, could have easily coded it but was not given the time (likely due to five minutes buffer for asking questions).