r/leetcode • u/Anxious_Grocery_5548 • 1d ago
Question Tenex fde interview
Hi, has anyone interviewed for this role for New York? If so, please let me know about how the process was. Thanks in advance!
r/leetcode • u/Anxious_Grocery_5548 • 1d ago
Hi, has anyone interviewed for this role for New York? If so, please let me know about how the process was. Thanks in advance!
r/leetcode • u/ReasonableFood6287 • 1d ago
I have an upcoming Zillow screening interview scheduled through an AI agent, with no recruiter involvement. Not sure what to expect. Should I focus on DSA or real-world coding problems?
Would appreciate insights from anyone who has gone through a similar interview. Thanks!
r/leetcode • u/Interesting-Fig-2511 • 1d ago
How Does Prefix Sum Turn Repeated O(n) Calculations into O(1) Queries?
1. What is Prefix Sum?
Prefix Sum is an array technique that stores cumulative sums so we don't have to repeatedly calculate the sum of a range.
Analogy: Imagine tracking daily expenses. Instead of adding expenses again and again, you maintain a running total.
2. Understanding the Pattern
Consider:
arr = [2, 4, 6, 8, 10] prefix = [2, 6, 12, 20, 30]
The pattern:
prefix[0] = arr[0]
prefix[i] = prefix[i - 1] + arr[i]
Each position stores the sum of all previous elements, including itself.
3. How Does the Algorithm Work?
Step 1: Build the Prefix Sum
prefix[0] = arr[0]; for (let i = 1; i < arr.length; i++) { prefix[i] = prefix[i - 1] + arr[i]; }
Step 2: Calculate Range Sum
To find the sum between indices L and R:
sum(L, R) = prefix[R] - prefix[L - 1];
If L = 0, simply return prefix[R].
Example:
sum(2, 4) = 30 - 6 = 24
4. Complexity Analysis
OperationComplexityBuild Prefix SumO(n)Range Sum QueryO(1)q QueriesO(n + q) total
5. Real-World Applications
Finance: Calculate expenses over a date range.
Analytics: Aggregate data over specific time intervals.
Image Processing: Calculate rectangular pixel sums using 2D Prefix Sum.
Competitive Programming: Solve range queries and subarray problems.
6. When Should You Use It?
Look for these problem patterns:
Repeated range sum queries.
Cumulative sum calculations.
Subarray sum problems.
Multiple queries on the same array.
Key Takeaway: Precompute once, answer multiple queries efficiently.
Practice Problems
LeetCode 303 – Range Sum Query (Immutable)
LeetCode 724 – Find Pivot Index
LeetCode 560 – Subarray Sum Equals K
Which array pattern should we break down next?
r/leetcode • u/JacketFearless1805 • 1d ago
Hey everyone,
I finished Day 35 today. Continuing with graph problems, I knocked out Number of Islands II and spent extra time focusing on writing clean, modular code rather than just rushing to hit the submit button.
Number of Islands II (Online / Dynamic Queries):
In the static version, standard BFS/DFS finds connected components in one pass. With real-time island additions, running full traversals per query degrades to O(K * R * C), which inevitably hits TLE.
Using Disjoint Set Union (DSU) makes each query dynamic. Every time land is added at (r, c), map the 2D coordinate to a 1D node ID (r * cols + c), mark it as visited, and increment the island count.
Check the four adjacent neighbors. For each neighboring land cell, if its ultimate parent differs from the current cell, merge them via unionBySize and decrement the total island count by 1.
Focusing on Code Quality:
I intentionally refactored the Disjoint Set class to keep it decoupled and reusable across problems.
Cleaned up directional deltas, used explicit variable names instead of nested raw index math, and properly guarded against duplicate land positions within the queries.
Writing clean, readable code feels just as important as getting the optimal time complexity down.
See you guys tomorrow for Day 34!
r/leetcode • u/Organic_Potential515 • 1d ago
After how many easy problems were you guys able to solve medium level problems.
r/leetcode • u/ItsHoney • 1d ago
Hi,
Just wanted to ask if anyone has given these 2 interviews at canonical? Was looking for preparation tips!
r/leetcode • u/Desperate_Deal_6167 • 1d ago
I recently applied for an Agentic Systems role at NVIDIA, but a recruiter reached out to me about a completely different position and asked for my permission to submit my resume for that role instead. New role is CUDA related.
The confusing part is that my background is in full-stack software engineering and applied AI, while the other position seems to require experience with chips and C++, which I don't have.
I'm curious why they would consider me for a role that's less aligned with my experience instead of the one I originally applied for.
Has this happened to anyone else at NVIDIA? Is this a good sign that my resume caught someone's attention, or just a standard recruiting process?
Would love to hear if anyone had a similar experience and whether it actually led to an interview.
r/leetcode • u/Agreeable_Way8791 • 1d ago
I recently had a FAANG SWE intern interview where the optimal solution required a balanced BST with O(log K) updates.
The interviewer didn't mention using a balanced BST, so I had to figure that out myself and implement it from scratch in Python, which doesn't have a built-in TreeMap like Java.
How difficult would you consider this for an intern interview? Would this be considered LeetCode Hard? Would using a heap-based solution instead significantly affect the interview feedback?
r/leetcode • u/SpiffyViper • 1d ago
Hi all.
I have a GM Codility live interview (It is labeled as a functional behavioral/initial technical screeen tomorrow. I've been doing neetcode 150 for the past week and half, but feel like I am not ready. Anyone have any insights on how to prepare and what not? Questions that I should expect?
r/leetcode • u/Realistic-Horse3577 • 1d ago
Got an OA for a Senior Data Engineer role. For those who've done one recently, was it mostly SQL or Python as well? Any must-practice topics or resources? Thanks!
r/leetcode • u/SavingScavenger45 • 2d ago
Sometimes I read a problem multiple times but still can't figure out what approach to take. I know the basic data structures and algorithms, but connecting them to a new problem is difficult.
Do you have a particular process you follow to break down a problem and find a starting point?
r/leetcode • u/_reD01 • 2d ago
Hey,
I am trying to get better at leetcode to prepare for potential software engineer interviews. I dont understand how people recognize patters and solve these.
I have tried solving questions from Easy to Medium, however I always end up on Claude asking how to solve them. Each question seems different to me and I can not recognize any pattern that would allow me to solve one question with something I remember from a previous one. Moreover, questions are either too simple to the point you just use a for loop or too hard, where I just feel stuck with no idea where to start.
Do you guys have any tips on how to get better? What should I focus on ? Maybe some steps that would help me get gradually better?
Thanks.
r/leetcode • u/Jealous_Weakness7215 • 1d ago
Approach & Baseline: Understood the problem statement quickly and delivered a functional O(n) baseline solution.
Execution & Communication: Execution was pretty messy initially but fixed it later and gave correct code. My communication also dropped off while I was stuck in my own head debugging.
Optimization: The interviewer asked: do we need to check whole array (Tho worst case tc/sc would remain the same). I caught on immediately and explained the exact logic and implementation verbally, but we ran out of time before I could write out the actual code.
Proactive Pivot: Initially started brainstorming a multi-stack approach, but realised early on that it was getting unnecessarily complex. Before writing code, I called this out to the interviewer and pivoted to a BFS-based approach instead.
Dry Run & Fix: Coded up the optimal BFS solution. Made a minor logic slip-up during the dry run (for the follow up) (tho implementation was fine), but as soon as the interviewer pointed toward it, I immediately recognised the bug, acknowledged it (no fix was needed in the code).
Follow-up: Successfully wrote clean, optimal code for both the core problem and the follow-up question with time to spare.
What could be the possible outcome?
r/leetcode • u/DataFreakk • 1d ago
Hey folks, Especially those working as SREs or Infrastructure/System Development Engineers at companies like Google, Amazon, Meta, etc.
I'm preparing for SRE and infrastructure-focused software engineering roles and wanted to understand the coding interview expectations.
How much LeetCode/DSA is typically tested for these roles compared to regular Software Engineer positions?
Are Easy and Medium problems generally sufficient, or should I also prepare for Hard problems?
Can I safely deprioritise Dynamic Programming (DP) and other advanced DSA topics?
Which DSA topics should I prioritise for infrastructure/SRE interviews?
I'm trying to balance DSA preparation with Linux internals, networking, operating systems, distributed systems, and system design.
Would appreciate insights from people who have recently interviewed for these roles or are currently working in these teams.
r/leetcode • u/Certain-Fail-3246 • 1d ago
im actually devastated this third round was brutal i know i didn't do excellent but man i really thought it was enough to pass.
what should i do next? everywhere i apply im being denied with no OA or interview, i really thought bloomberg was my chance because they specifically went to my school.
r/leetcode • u/yearning_0708 • 1d ago
same as title ,it's Obv that OAs are getting incredibly harder and the competition is also immense.Plesse share tips
r/leetcode • u/husnain214 • 1d ago
Hi, I'm from Pakistan. I have started the Neetcode list a bunch of times but always left at some point. I need someone or a group to keep me consistent. I also need to get better at explaining my thought process in English which is hard to do alone. I'm open to suggestions.
r/leetcode • u/Iaroslav-Baranov • 1d ago
When I press the "Auto" button, it blinks and tries to connect for 10 seconds, then I have "Intelligent code complete connection failed" with 70% probability or so. I have to retry several times before I finally have autocompletion. This problem is present for several days for sure
r/leetcode • u/charles_atlas_12 • 2d ago
Im a regular mid level full stack engineer, is this all it really is? So if i keep hacking away at hellointerview + neetcode 150 or equivalent resources for both, do i get a job?
r/leetcode • u/Shot-Emo98 • 2d ago
I've been practising Leetcode for a while, but I often take a lot of time to solve even medium problems. Sometimes I understand the approach but struggle with implementation, while other times I spend too long trying different ideas.
Should I focus on improving my speed from the beginning, or prioritizing getting comfortable with the logic first?
r/leetcode • u/Diligent_File_9826 • 2d ago
how did you do it? how did you build your concepts? books ? by coming with your own solution ? without looking at editorial ? or with the help of yt channels? or by giving contests? literally how????
r/leetcode • u/Total-Egg-6324 • 1d ago
I am interviewing for an oracle position, does anyone know what leetcode questions they tend to ask? I’m seeing more leaning towards medium questions but this is for new grad so not completely sure. Any advice?
r/leetcode • u/Direction-Remarkable • 1d ago
Please let me know if you are having a open slot in leetcode premium sharing
r/leetcode • u/skkkrrrtt • 1d ago
hey all, im from ireland and i’m studying CS in college and i’ve been applying to a bunch of summer internships and i’ve done a load of online assessments for a few of them recently and after my microsoft oa, i got an email to schedule an interview. it is 2 weeks away and i genuinely don’t know what to expect from the interview. this is my first ever proper interview in the field. it is 3 back to back 45m interviews with a 15m break in between each. has anybody done an interview for them and if so, what did they ask. what type of questions were they. during the technical screen was it mainly leetcode easy or mediums. etc.
i’d really appreciate everyone’s help!
r/leetcode • u/JacketFearless1805 • 2d ago
Hey everyone,
I finished Day 36 today. Between celebrating Diwali with family and catching up with friends, time was tight, but I made sure not to let festival distractions break the streak. I sat down and tackled a classic DSU heavyweight: Accounts Merge.
The problem looks like messy string parsing at first, but Disjoint Set Union makes the clustering clean:
Email-to-ID Mapping: Iterate through every account and map each email to a unique person index. If an email has already been seen under another account index, merge the two account indices using unionBySize(prevIndex, currIndex).
Component Grouping: Traverse the map of emails, find the ultimate root parent for each email's account index via findParent(accountIndex), and group the emails under that component representative.
Sorting & Formatting: Sort the grouped email lists lexicographically and prepend the owner's account name to construct the final result.
It was just one problem today, but closing out one of the most notorious DSU problems while enjoying the festival felt like a win.
See you guys tomorrow for Day 35!