Same boat for me. I just started prep for the first time in my life and at the beginning I was struggling with easies. 2 weeks after I started I could pick up most easies but no mediums. One week after that (today) and I can solve some mediums with great difficulty. Not sure how linear this progress will be but I think the 6 month prep timeframe I gave myself was too generous, at this rate I may only need 3-4
Guys I really didn't think anybody could solve these in 5-10 mins that's why didn't add. If you guys are not trolling, can you please tell us how did you get so better, or were you good at it from start.
It's not true that no one can solve it in 5-10 mins. Check Google codejam finals for this year. They explain all the questions and solutions at the end of the round as well. LC mediums and even LC hard are nothing in front of those and the contestants still manage to solve around 4-5 of those super hard questions in 1.5 hours. I was blown away by the difficulty and skill there.
But that's talking about best of the best. You can even see leetcode contests where first 200-300 people solve all 4 in much less than 1 hour.
It needs a lot of hardwork but beyond a certain level you gotta have a high IQ too, only hardwork can't land you in a codejam final. But good thing is that interviews are not that hard. Most people can reach the level where they can crack Google by hardwork and commitment. And some geniuses don't even sweat while cracking it.
OP dont sweat it. It's like running the more u do it the faster u get. Just have to train for it. LC doesn't require a lot of creativity. It's more of a get used to basics and keep practicing kind of thing.
Now, will some people here troll? Definitely. But 10 mins though isn't very common, it's also not rarity.
Thanks for reassuring me, need this more I think. Interview questions for me have been hard level in past so couldn't code them with all test cases or optimally in an hour. I know it sucks but can't do any good. I'm not a bad programmer as such but somehow feel this software job is no more for me because of these interviews.
Yes for a few data structures, and only in the beginning. Python modules like heapq and bintrees for example, you're almost never going to use those in day to day SWE life. Becomes muscle memory pretty quickly.
I was expected to code 2 leetcode mediums in fb on site in all 3 coding rounds, 45 mins each round, which I did. And then we had 10 mins left over for chat. So I would say it took around 10 mins after reading the question to come up with a solution and solve it. Writing on whiteboard takes longer than typing, that's why 10 mins and not 15.
During practice, I solved around 50 questions from various topics to implement basic structures. Like bfs, dfs, hash map etc. These code should be muscle memory by end of 50 questions. Solve the same 50 questions more than once if needed. Then after you have nailed the implementation, all you need to do is to read the questions and think about algorithm in your head. If you can solve it in your head, typing and wasting time isn't something I would do. I could read and come up solutions in 5 mins for each question, and would do this with 200 questions. Took me 3 days.
So overall, a week of strategic practice is enough to be able to solve leetcode medium questions under 10 mins. If you just start solving leetcode without a strategy in mind, then you're not learning anything new, you're just giving exam based on what you already know. That's stupid as fuck,and won't get you anywhere.