How come you guys get so good at leetcode and crack google/netflix interview in just matter of few weeks. I am struggling to keep myself motivated to do this leetcode shit. I think its a test for my consistence and perseverance more than the coding skills.
Anyone here who took more than 6 months? Please share your struggle story.
For DS and Algos, I never touched anything other than LC. I have practiced around 320+ questions.
When I started practicing around a few months back, it use to take me around 20-30 mins to solve even an easy question. And I used to take a long time to solve each question but I knew that things would get easier.
I was mainly focusing on getting my understanding of Collections and Arrays right! I would also spend a lot of time on googling which collection to use in which cases. Overtime, I started getting a good grasp of it. I started asking myself questions like how do I decide if I want to use a Priority Queue or a TreeMap?
After 1 month, when I started feeling confident about the DS, I moved on to a bit more advanced topics like Trees, Graphs and DP because all these topics use the basic collections I had already studied. I would solved questions on these topics and the previous topics in a mixed manner (didn’t give too much importance to one topic over the other). Then, one day my friend asked me as to why I haven’t looked at the Trie DS? It was the best input ever! One of my rounds, both at Amazon and Google, focused only on Trie!
Over a period of 2-2.5 months, I could see that I was solving easy questions in under 10 mins and medium questions in around 20 mins, on a compiler!
Also, there is no point in keep solving new questions. it is very important that you keep revisiting your old solutions every now and then. Not only you will realize that you had forgotten quite a few solutions but also, you will realize that you have started thinking about smarter and cleaner code over time!
P.S.- I was a C++ developer until 5 months back. Right when I made a switch to Java, was around the time I had started preparing for interviews as well. So, I had no idea how to use collections and all that. That’s why, I had to start ground up!