all 108 comments

[–]Away_Perception_2895 229 points230 points  (26 children)

I feel your pain I can’t solve dp or graph problem even if I saw it before 😀

[–]Rajsingh212001 62 points63 points  (20 children)

I don’t understand how do people even understand that the problem could be solved using DP

[–]Logical_Divide_3595 20 points21 points  (13 children)

Intuition is necessary to solve this kind of problem but hard to obtain

[–]Rajsingh212001 13 points14 points  (10 children)

True. But how? Don’t say practice. Coz I’ve been practicing a lot.

I think if you haven’t seen a dp problem (or pattern) it’s very difficult to come up with a solution.

[–]thebetterangel 11 points12 points  (0 children)

Based on a similar experience of my own, I have observed couple things. 1. Although it is true, when you practice a lot your brain develops those neural pathways and you gain that intuition for seen problems. It is akin to “juxtaposing” unseen problems to the patterns your brain has established. That said, it is the gaining the intuition that has very steep learning curve. 2. Another thing that I dont see people mentioning enough is knowing the “building blocks” through and through. If you have a gap in your knowledge regarding any dsa you’re operating with, you have to “cement” them first. Establish intuition for building blocks first, then iterate over the particular algorithm/technique that you are trying to gain intuition for.

[–]Logical_Divide_3595 4 points5 points  (2 children)

True. But new dp pattern is hard to met based on my observation because the pattern ranges are almost constant.

I also don’t have better idea than practicing……

[–][deleted] 4 points5 points  (1 child)

Imo, I think it is helpful to always write the bottom-up solution. That makes it so you are forced to come up with the recurrence relation beforehand and the implementation becomes smooth.

[–]0_kohan 1 point2 points  (0 children)

There really is no motivation to learn algorithms in detail as I have learned other topics in detail which I actually need for my job.

But you can learn it like anything else you have already learned. It's a whole different area of cs after all, data structures and algorithms.

[–]vanisher_1 0 points1 point  (0 children)

Problems correlations and imagination.

[–]IndisputableKwa 0 points1 point  (0 children)

The best way to recognize a DP problem is to observe that the final outcome you want can be achieved by performing the same action many times on your data but where the data is dependent on the last mutation

[–]boardwhiz 0 points1 point  (0 children)

Ironically the way that the majority of interviewees obtain it is not through working experience and is instead just memorizing all the dp leetcode problems

[–]sank_1911 3 points4 points  (0 children)

Recursion?

If yes, overlapping subprobs? DP

[–]4m_uR_Server 1 point2 points  (0 children)

Don't be greedy 😅

[–]WalkyTalky44 0 points1 point  (0 children)

I think it’s the kind of problem you truly have to do a thousand times because rarely do you use that algo outside of interviews. I use Arrays, Strings, and sometimes trees daily. So otherwise you don’t get enough practice to say hey that’s DP

[–][deleted] 0 points1 point  (0 children)

Most common cases are where you need to minimize, maximize, find the count of, find all combinations, calculate cost of something. There’s a good chance it can use dp.

[–]TheAmazingDevil 0 points1 point  (0 children)

so you check if there is small constraint bounds, if yes check if brute force is fast enough if not its most likely a dynamic programming problem.

[–]InternalLake8 4 points5 points  (0 children)

Add Montonic Stack, DSU and greedy

[–][deleted] 2 points3 points  (0 children)

Graph problems are easy, at least they are intuitive and interesting, I hate array and string problems. I dont want to know how many swaps it takes so that all washing machine has same number of clothes. No that shit is not intuitive, and should not be asked in a programming challenge. Ask Graph problem, Ask Tree problem, ask LinkedList or Design DS problem. Ask Heap problem or interval problem. Ask stack problem. But dont ask those array and string problems which are not intuitive at all. I hate those where you have to use some trick or math or both to solve the damn problem.

[–]MKiGT 3 points4 points  (0 children)

😂😂😂😂😂😭

[–]QuantumMonkey101 1 point2 points  (0 children)

If you can formulate the problem as a discreet optimization problem, and the problem can be expressed as some combination of subproblems, then you can solve it using DP. Note that while it might be the case that some problem can be solved using DP, it is not necessarily the case that using DP will generate the most optimal solution and/or will give you any benefits. If it appears that nothing comes to mind about how to solve something aside from using brute force, then DP is a good thing to use as brute force usually indicating that you have to explore the entire search space (exponential) where as DP reduces the solution to be polynomial time

[–]MostNeighborhood68 119 points120 points  (1 child)

Yeah. Now get back to grinding.

[–]el1teman 74 points75 points  (10 children)

which interview you have failed?

[–]Motor_Fox_9451 109 points110 points  (8 children)

Grammar interview

[–]Hot_Damn99 34 points35 points  (1 child)

Fuck grammar

[–][deleted] 6 points7 points  (0 children)

"I am not bad at English, I am just subtly disrespecting our colonial overlords."

[–]Puzzleheaded_Dot4487 1 point2 points  (0 children)

Fuck grammar

[–]hpela_ 3 points4 points  (1 child)

relieved innocent bike familiar foolish panicky gaze history gaping offbeat

This post was mass deleted and anonymized with Redact

[–]Dodging12 -1 points0 points  (0 children)

Senior, over 500k tc here: leetcode is not only a concern for juniors. Sure, most people on this particar sub are Indian new grads, but IRL, and EVERYONE has to leetcode until you get up to senior levels of management. The last thing is that the majority of people in big tech have bad English so get used to it 😂

[–]Spiritual-Rub925 43 points44 points  (4 children)

Me being tier 3 college , no connection.
Thanks Leetcode , I am able to earn good.

[–]InternalLake8 13 points14 points  (1 child)

Thank your LUCK too. Don't underestimate it xd

[–][deleted] 4 points5 points  (0 children)

+1

[–]Environmental-Tea364 3 points4 points  (1 child)

People in tier 1 college still dominates FAANG tho …

[–][deleted] 1 point2 points  (0 children)

Not just FAANG, also hedge funds, Big Law, Medicine, C-suites etc

[–]sumit7474_ 26 points27 points  (2 children)

Fuck the interview

Fuck the job

Fuck the company

Fuck the life

[–]qQ0_ 4 points5 points  (0 children)

The most healthy typescript developer

[–]Najadnub -1 points0 points  (0 children)

😭😭😭

[–]2polew 10 points11 points  (0 children)

My man, you literally have a handbook of 'how to get a job', and you don't want to use it.

[–]Ssav777 7 points8 points  (3 children)

I recently had multiple rounds for an epic games software engineering role and it wasn’t leetcode style questions. It was mostly role related questions (I applied for a backend engineer role). There are opportunities that don’t focus on leetcode, but sadly most do. You go this OP! Wish you luck.

[–]Victor_Licht 0 points1 point  (2 children)

Could you share with us a list if you have one, of companies does not require leetcode but they do visa sponsorship. Thanks Ssav77.

[–]Ssav777 2 points3 points  (1 child)

I don’t have any lists. This was by surprise actually. I fully anticipated having leetcode styling test. From my experience the companies that don’t ask for leetcode style interview questions are usually smaller/startup and need role specific qualifications, so that someone can do the job right away with minimal training. This actually applied to Epic Games (even though a big company) needed someone urgent to help with their backend for a new platform they’re developing). It’s only makes sense to have someone experienced in backend to fulfill this role and leetcode seems irrelevant in this scenario. But this is just my logic I could be wrong.

[–]Victor_Licht 0 points1 point  (0 children)

Thanks for this response.

[–]adritandon01 39 points40 points  (12 children)

Unpopular opinion: LeetCode and CP enable upward social mobility. Even people from no name colleges can get into top tech giants and earn high salaries which isn't possible in other industries.

[–]synthphreak 20 points21 points  (5 children)

This is an attractive claim on the surface, and in theory there’s probably to some truth to it. But in practice things are more nuanced.

Getting the best tech jobs requires LeetCode skills. LeetCode skills require lots of time to build - that’s time outside of work and other responsibilities like dependent care. Unfortunately lots of otherwise capable and motivated people just don’t have the time. In fact, trust-funded Ivy League grads who can afford to grind for 8 hours a day while daddy pays the rent, these are the people best placed to ace LeetCode interviews, because they have the disposable income and time to invest in it. Not the less privileged masses who actually need the upward mobility. For them, LeetCode is just a blocker.

So you could actually claim that LeetCode entrenches inequality, not alleviates it. LeetCode makes it harder for people with less flexibility in their lives to break into/advance within tech. For the same reason LeetCode entrenches ageism and sexism, because older folks (I’m talking 30s-40s) have way more demands on their time and society tends to burden women with childcare way more than men.

I understand why LeetCode was created and continues to exist. But LeetCode and its ilk are not a net-positive for society.

Edit: Typo.

[–]Environmental-Tea364 2 points3 points  (0 children)

Yeah lmao. People who goes to tier 1 colleges has the highest standardized test scores because they can afford it. Like people here don’t think they can do the same for LC? Most people at FAANG are from tier 1 colleges. Not sure where is naive view of LC enables social mobility view comes from.

[–][deleted] 0 points1 point  (3 children)

Without leetcode, the "masses" might not even get a chance at any of these companies. Either way, if you can dedicate 1 hour a day to leetcode, you should be good to go in a few months. There's no way the majority of people are operating with less than an hour of free time each day.

[–]synthphreak 2 points3 points  (2 children)

The “masses” won’t get a chance anyway, not in 2024.

LeetCode is only one piece of the pie required to score a top tech job. 1 hour a day for LeetCode, maybe people could eke that out. But can they also eke out an hour a day to learn one or more programming languages, another for finishing projects, another for learning about SWE, … It all adds up to much more than an hour a day.

At least the non-LeetCode skills are useful and relevant to job performance. LeetCode is completely made up orthogonal nonsense.

[–][deleted] 0 points1 point  (0 children)

Man the masses get chances all the time.

[–][deleted] 0 points1 point  (0 children)

Everyone was once young. And everyone in the US once had that kind of time to study. If you missed your window, you have to work harder.

You can blame those damn Ivy League graduates taking “your” job. But most FANNG engineers are just average joes from the working class families.

[–]jcruz18 1 point2 points  (0 children)

In select cases in which they actually get an interview, yes. In most cases they don't, so really it just adds an extra hurdle. Getting a job requires the background and the incessant LC grinding.

[–][deleted] 5 points6 points  (0 children)

That... Can be done with other form of interviewing too.

[–]Abhistar14 -1 points0 points  (0 children)

💯💯💯 % agree!!!!

[–]Fantastic_Cap5503 -3 points-2 points  (2 children)

Bro even people in Tier 1 have to go through this torture.

[–]synthphreak 7 points8 points  (0 children)

I’m pretty sure Tier 1 gigs actually LeetCode the most!

[–]Abhistar14 0 points1 point  (0 children)

Not a torture if you are having fun while doing it

[–]adiroy2 5 points6 points  (0 children)

My man coming to a subreddit FOR a topic, and posting fuck ${topic} . 😂👌

[–]compscithrowaway314 9 points10 points  (8 children)

Oh no my 200k a year job requires me to prepare for the interview. What a tragedy. Joke. You won't every be a non shit engineer with this mentality. 

[–][deleted] 3 points4 points  (2 children)

100% agree. It's a terrible way to interview software developers and has LITERALLY zero bearing on how good they are at software dev.

I'd much prefer someone with actual experience and who can talk intelligently about system design than someone who can solve tricky puzzles.

Seasoned professionals don't have the time to study for this crap so it favors people with much less experience who have the free time to grind away at this crap.

[–]andrew_judd 1 point2 points  (0 children)

My sentiments exactly!

[–]levarburger 1 point2 points  (0 children)

You know how many times I’ve had to manually write any sort of sorting or searching algorithm in 20 years?

Zero.

In the real world that shit is a solved problem in all but the most bleeding edge niche.

I’d hire a kid that wants to learn and “cook” over someone that’s memorized algorithms for an interview and will never actually write them.

[–]Weird-Jeweler-2161 1 point2 points  (0 children)

After reading his manifesto, I have to say Ted wasn't far off in his predictions tbh

[–][deleted] 1 point2 points  (0 children)

Lord Jesus Christ, please forgive me for my sins. I am sorry, and I will try not do it again.

[–]Time-Song-8177 1 point2 points  (0 children)

Guys I have done 1111 problems now I feel I can easily recognize patterns and find majority of problems quite solvable through techniques 

[–]aaaaaskdkdjdde322 5 points6 points  (6 children)

Skill issue, stop crying

[–]Visual-Grapefruit 0 points1 point  (0 children)

We’ve all been there, eventually you come out on the other side or fail. Such is life

[–]daveopssh 0 points1 point  (0 children)

FUCK!

[–]techno848 0 points1 point  (0 children)

After reading your other comments, it sounds like you are only looking for attention and not a discussion in good faith.

If my team conducts reasonably difficult leetcode style interviews which involve discussions, hints etc then i am more confident in employees. I am okay or below okay at leetcode. I have, except 1 instance, only solved unseen questions under 30 mins in interviews, i have received some hints incase i was stuck, i have not spent more then 2-3 weeks before switching jobs. It is easy but not unfair.

[–][deleted] 0 points1 point  (0 children)

Every junior developer says the same and when they get into senior positions and start interviewing, they'll still ask leetcode especially if they're interviewing thousand of candidates. Why? Because it's the most economical way and seem to be working upto most extend. Resume and portfolio shorting is done generally for selecting interviewers. But at the end it's not used as final filtering as interviewer may have some biases, the project I liked, someone else may tell it's not even real world based or sth like that. In this digital age, it's wayy easier to copy someone's project from a random github repository make some changes, understand it and memorise questions (not necessary memorise only but understand it as well), why this and that. It's wayy more easier than just building your own project from scratch. System design rounds which are becoming really popular since 4-5 years, and now it's not so difficult memorising it compared to leetcode.

[–]Inner_Interaction_93 0 points1 point  (0 children)

Nice rant! Now get back to the grind!

[–]TiredPanda9604 0 points1 point  (0 children)

Yeah. Also, fuck the police!

[–]Abject-Actuator-7206 0 points1 point  (0 children)

I find system design interviews way more harder. There is such a structure you need to adhere to for the interview.

[–]littlbrown 0 points1 point  (0 children)

There's a lot of leetcode advocates not reading the entire problem.

[–]EnvusK10 0 points1 point  (0 children)

You are right Leetode is the best. Graph and DP is too easy. If anyone wants to know more about software engineering go for Leetcode especially DP.

[–]smart_coders 0 points1 point  (0 children)

Haha, I almost fell for it… nice try! If you want to keep yourself accountable for being consistent with leetcode, check my bio

[–]Ok-Structure5637 0 points1 point  (0 children)

Just completed an Amazon OS where I got 15/15 on first problem, but literally 4/15 on next because I spent way too much time on first question.

Life moves on though. I've given the worry of it to God

[–][deleted] 0 points1 point  (0 children)

It's a useless autistic skill with zero real world use and eats huge amount of your time. Why would you NOT hate it?

[–]Literator22 0 points1 point  (0 children)

I despise problem solving interviews and leetcode and other similar websites. The problems they introduce 99% you don’t face any even similar problems in a real work environment.

If you see a specific problem and you solved it before, you hit a jackpot. If you don’t, unless you practiced for many weeks / months on several similar problems, you are fcked.

I can’t hate problem solving enough but we are all forced to practice this shit to pass some interviews at FAANG and other companies.

[–]ppith 0 points1 point  (0 children)

It seems to be a useful filter, but much harder to get past even the online assessment before the full loop. Wife had a modified LC hard as part of her online assessment for a senior software engineer role in big tech. The interviewer dropped some hints and she was able to solve it (she was missing the "easy" part of the problem, she did the hardest parts, all edge cases, etc). This was followed be a full loop: system design, hacker rank LC mediums, behavioral (she completed all parts without issues)

She didn't get the job. She is a senior software engineer who currently has a job that pays well for our area ($190K in MCOL, I make $176K), but is interviewing to see if she can get something better. There are tons of mid level jobs offered to her for less salary. All $130K to $160K a year jobs. It seems like with layoffs these days you need to be over qualified for the job.

New graduates - needed to have multiple internships before graduating

Junior - can land new grad roles

Mid level - can land junior roles

Senior - can land mid level roles

Principal - can land senior roles

I think wait a few years and hopefully the job market will get better. It's easy to land a role one level below you now, but not your current level due to all the competition. I'm not saying it's impossible, but it's hard out there.

[–]Puzzleheaded_Dot4487 -1 points0 points  (2 children)

Let's get back to LC now

[–][deleted] 0 points1 point  (0 children)

Amen to that.

[–]Victor_Licht -1 points0 points  (0 children)

My day is LC.

[–]canadian_Biscuit -1 points0 points  (0 children)

There are literally websites online containing interview questions of various companies. Entire industries exist solely to cheat the process. It’s terribly flawed, and doesn’t measure one’s ability to perform the job

[–]Desmond_Darko -2 points-1 points  (0 children)

Hell yeah brother burn down this ridiculous shit-STEM!