r/LeetcodeChallenge • u/NegotiationDapper584 • 8h ago
r/LeetcodeChallenge • u/NotYourCheesecakee • Nov 15 '25
šWelcome to r/LeetcodeChallenge -Read the Rules!
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 • u/JacketFearless1805 • 1h ago
STREAKš„š„š„ Day 60: knocked out 5 DP on strings problems today, knowing when to stop before burnout
r/LeetcodeChallenge • u/jury-god-anugrah • 5h ago
PLACEMENTS What is the best way to start the dsa and how much dsa will be enough for placement purpose
I have only 3 months left before semester exams. So somebody who had an idea how I would complete dsa and mern( mern mai kr lunga sath mai kuki web development jaldi smjh skta hu mai) dsa ke liye proper khuch smjh nhi aa rha logic aa rhe h but striver se padha toh vo cpp se krata h and mai java se hu , jab raghav garg se padha toh question mujhe khud hi krne h isliye thoda idea dedo koi , abhi tak mai randomly leetcode attempt kr rha tha and yes mujhe smjh aaye bhi question and solve bhi kiye h ache se
r/LeetcodeChallenge • u/nian2326076 • 11h ago
DISCUSS Roughly 320 solved problems, but I couldnāt reliably re-solve them cold. How do you measure readiness?
How many problems in a Solved list could you solve from a blank editor, with someone watching?
A candidate had solved roughly 320 LeetCode problems but still froze halfway through implementations. Even problems from a few weeks earlier could be hard to derive again. The green checkmarks were hiding gaps in recall and explanation.
The candidate started checking more after Accepted: identify the pattern without a hint, explain the approach before coding, justify time and space complexity, find edge cases, and dry-run the implementation. Doing that with a clock running exposes different gaps from solving alone.
Review also changed. Opening an old solution and recognizing ātwo pointersā felt easy, but didn't show whether the reasoning could be reconstructed. Re-solving from a blank editor did. Harder problems came back sooner; easier ones could wait a few days, then a week or two, then about a month.
The spreadsheet, notes, and calendar reminders eventually became another chore. A lighter routine was easier to maintain: a minute or two of reflection, a short note on the mistake, and a manageable daily review load that left room for unfamiliar patterns.
Real technical interview questions can supply fresh prompts for checking whether a pattern transfers. If applications are competing with practice time, Agent autoapply and application autofill can reduce repeated application paperwork.
What tells you you're ready to interview? How do you distinguish knowing a pattern from recognizing a problem you've already seen?
Disclosure: I operate PracHub and LandOffer.
r/LeetcodeChallenge • u/StatisticianNo2104 • 4h ago
DISCUSS Last N lines of a log in Go without holding the whole file
A function that returns 200 log lines, and keeps 186 MB alive after it returns. The 200 lines are about 20 KB.
The job: a crash reporter attaches the last 200 lines of the request log to the report. The log is a stream - a scanner over a file, a cursor over a table, a channel fed by a tailer. It hands you lines in order and does not know how many there are.
```
var all []string
for line := range log {
all = append(all, line)
}
return all[len(all)-n:]
```
I have written that in two languages. One idea, reads like the ticket.
Then I measured the live heap with the answer still held, rather than the clock. Two million lines:Ā 186 MB, still there after the function has gone out of scope.
all[len(all)-n:]Ā is a window onto the arrayĀ allĀ grew into, not a new array, and a slice keeps its whole backing array alive. A test reads the capacity off the returned value:Ā len 200, cap 169,032.
One line fixes the retention.Ā Copy the tail into a slice of its own, and 186 MB becomes 20.8 KB. If you take one thing from this post, take that.
It does not fix the peak. The copy runs after the collection finishes, so the two million lines were all in memory a moment earlier, and that moment is where a container gets killed.
Counting the stream first and walking it again is exactlyĀ 2.00xĀ at every size in the benchmark, and it needs a way toĀ startĀ the walk twice - which a file gives you and a socket does not.
What the data was actually saying: the only lines that can be in the answer are the 200 most recent ones, and that is true after every line, not just at the end. So keep 200 and evict the oldest. A fixed-size buffer that wraps does it with no bookkeeping, because the write cursor and the oldest line are exactly n apart and never drift. That gap is the length nobody computes.
8528x less heldĀ on a two-million-line log. And, honestly:Ā 1.08xĀ on the clock. This is a memory fix and selling it as anything else gets it rejected by a reviewer who benchmarked throughput.
The benchmark's own allocation column says 1.98x, because both versions allocate every line - the scanner produces them either way. Allocation 1.98x, retention 8528x. A profiler pointed at allocation shows you the first number and shrugs.
At a few hundred lines, collect it. 34 microseconds, 21.8 KB, and it answers the next question too.
That is days 20 and 24 of the daily challenge - Middle of the Linked List and Remove Nth Node From End - sitting in a crash reporter.
Full piece in today's Newsletter.
It worked in dev, episode 14.
https://www.linkedin.com/pulse/your-crash-report-held-186-mb-log-send-200-lines-archit-agarwal-hyyzc
#Golang #DSA #Algorithms #Performance #SoftwareEngineering #DataStructures #100DaysOfCode
r/LeetcodeChallenge • u/Relevant-Yesterday47 • 8h ago
DISCUSS Now I can see why tech companies like Leetcode interview
r/LeetcodeChallenge • u/Imaginary_Salary8374 • 8h ago
PLACEMENTS I know LOTS about productivity, dopamine, habits, and procrastination. So why canāt I consistently work for more than 2ā3 hours?
r/LeetcodeChallenge • u/Imaginary_Salary8374 • 8h ago
PLACEMENTS Striverās new 180 Sheet does anyone have the LeetCode links for all the questions?
r/LeetcodeChallenge • u/SpiritualAccident694 • 10h ago
STREAKš„š„š„ Day 10 did the question forgot to post it
r/LeetcodeChallenge • u/69speedster69 • 16h ago
DISCUSS Make your testcases look like this LOOOOL
r/LeetcodeChallenge • u/StatisticianNo2104 • 18h ago
STREAKš„š„š„ 365 Days of LeetCode Challenge ā Day 43/365
Graph Valid Tree (Medium)
https://leetcode.com/problems/graph-valid-tree/
A graph is a tree when it is connected and acyclic. Both are required - a forest is acyclic but disconnected, a triangle is connected but cyclic.
The shortcut: a tree on n nodes has exactly n-1 edges. So once you know the graph is connected, the edge count settles the cycle question. More than n-1 edges and connected means a cycle must exist, because n nodes cannot be joined by more than n-1 edges without one.
This solution never searches for a cycle. It counts.
For connectivity it uses union-find, which is the first structure in this arc that does not traverse anything. Every problem so far built an adjacency list and walked it. Union-find consumes the edge list directly and maintains one number, the component count, which is exactly the answer.
Worth noticing what it leaves on the table: when an edge's endpoints already share a root, that edge closes a cycle. This solution does not need that, but if a problem asks WHICH edge creates the cycle, it is sitting right there.
Full breakdown in today's newsletter article ā¬
https://www.linkedin.com/pulse/365-days-leetcode-challenge-day-43365-archit-agarwal-hsigc
#DSA #LeetCode #Golang #UnionFind #Graphs #CodingInterview #Algorithms
r/LeetcodeChallenge • u/inviun • 23h ago
DISCUSS How would you learn DSA if you had to start all over again in 2026?
Just help me to learn fast and give me some projects advice using c++ implementation of dsa on real life
r/LeetcodeChallenge • u/nian2326076 • 1d ago
DISCUSS Do LeetCode interviews still make sense in the AI era?
What should a coding interview measure when candidates have access to ChatGPT or Copilot?
A timed LeetCode problem can still show how someone breaks down a problem, explains an approach, and handles edge cases. But if the interviewer can't tell what help was used, the finished answer alone seems like a weak signal.
Would you keep that format and ask more follow-up questions, or move toward debugging, code review, and small changes to an existing project? If AI is allowed, I'd want to see the candidate explain and test the generated code, including what they'd do when it's wrong.
For candidates, real technical interview questions give examples to practice explaining out loud rather than just recognizing a solution. Application autofill and Agent autoapply address a different time sink: submitting applications, leaving more time for that prep. Any AI use during an interview still needs to follow the interviewer's rules.
Which format has given you the clearest picture of someone's engineering ability? And would your answer change if AI assistance were explicitly allowed?
Disclosure: I operate PracHub and LandOffer.
r/LeetcodeChallenge • u/JacketFearless1805 • 1d ago
STREAKš„š„š„ Day 61: started DP on strings today, patience with the pattern is finally showing results
r/LeetcodeChallenge • u/simrangupta95 • 1d ago
DISCUSS have solved around 300 LeetCode Problems but still struggling with mediums,What Am I Doing Wrong?
same as the title read
Iām in my 2nd year and have solved around 300+ LC problems but I still struggle with medium-level questions in contests
I can solve problems after seeing the solution or yk getting hints but when I face a new problem or if there is even slight change in constraints I get stuck I feel like Iām memorizing solutions instead of developing problem solving skills
How should I approach DSA to actually understand patterns and solve problems by myself?
should I focus on specific topics, follow a pattern-based approach or change the way i practice??
would appreciate advice from anyone who has faced this problem
r/LeetcodeChallenge • u/Fine_Arachnid510 • 1d ago
DISCUSS HackerRank SDE Internship HackerRank AI Interview ā Passed 13/15 Test Cases. Do I Still Have a Chance?(Round 2)
r/LeetcodeChallenge • u/StatisticianNo2104 • 1d ago
STREAKš„š„š„ 365 Days of LeetCode Challenge ā Day 42/365
Clone Graph (Medium)Ā https://leetcode.com/problems/clone-graph/
Copying a binary tree is four lines: make a node, recurse left, recurse right. It works because a tree cannot cycle and every node has one parent.
A graph gives up both guarantees, and each breaks the naive copy differently. Cycles mean A's copy needs B's copy, which needs A's copy, forever. Shared nodes mean a node reachable two ways gets copied twice, giving you the right values in the wrong shape.
One map from original to copy fixes both. Look it up before cloning; if the copy exists, return it. Cycles terminate because the second arrival returns instead of descending, and sharing survives because every original maps to exactly one copy.
Worth dwelling on: a plain visited SET would only fix the cycle. This has to map to the copies, because the copies are what the reconstruction wires together.
And the order matters. Record the new node in the map BEFORE cloning its neighbours, while it is still half-built. Recurse first, and a cycle returns to a node not yet in the map.
Full breakdown in today's newsletter article ā¬
https://www.linkedin.com/pulse/365-days-leetcode-challenge-day-42365-archit-agarwal-uztuc
#DSA #LeetCode #Golang #Graphs #DFS #CodingInterview #Algorithms
r/LeetcodeChallenge • u/Then-Revolution3818 • 1d ago
DISCUSS Help me out gnggg
Am currently pursuing my second year, I know the basics of python, java and c
Python<c<java
Which language should I do DSA in?
r/LeetcodeChallenge • u/nian2326076 • 2d ago
DISCUSS If you haven't seen the problem before, how do you solve it under Google's interview time pressure?
C'mon, some of these Google problems feel impossible to reason through under interview time pressure if you haven't seen the idea before. What does that end up rewarding: understanding, memorization, cheating or luck?
I don't think I'm lacking in aptitude, but the coding expectations feel unrealistic. I'd like to hear from people who've cleared the interviews about what happened when they got an unfamiliar problem.
The Google Interview Questions bank gives me more prompts to practice. Application autofill can save time applying to other companies too. What I'm struggling with is getting from a new problem to a workable approach while someone is watching the clock.
What helped you do that? Did you change how you practiced, how you talked through the problem, or when you asked for a hint?
r/LeetcodeChallenge • u/Quantum5hadow • 3d ago
STREAKš„š„š„ I AM DONE THAT'S IT FOR ME
hey everyone this has been my leetcode journey so far this year. honestly its been a rough year for me. lost people lost hope went through things i never really talk about and somewhere along the way i started losing myself too. i kept showing up anyway. started solving problems in kotlin even though it was a new language for me and spent so much time on problems and contests thinking maybe this would finally help me get a job. but im still jobless and its frustrating when you put so much of yourself into something and still dont know where its going.
some mornings leetcode is literally the only reason i get out of bed and try to do something productive. its become part of my routine even when everything else feels like its falling apart. but lately even this feels exhausting and for the first time im genuinely thinking about giving up.
just wanted to share my journey with people who might understand has anyone else been through something like this?


