Health & Wellness
5h
283
Deadlifts - severe lower back pain
Tech Industry
Yesterday
1404
I created a fake female Tinder profile for experiment
Tech Industry
Yesterday
992
MSFT Interviewer Tells Me To Stop Talking
Ask Blinders
Yesterday
1292
Do women prefer coffee dates since they can bail if they don't like the guy OR does it make them think the guy is cheap?
Tech Industry
4h
562
Jealousy witnessing my same-sex crush get married. Yes I work at Nvidia but I have nothing else.
How long does it take for you guys to solve a leetcode medium problem? On an average I end up taking 2-3 hours which includes understanding the problem, sometimes not knowing the solution to understanding the solution by watching some YouTube videos to finally solving it. It's very disappointing when it takes so long because I am only able to prepare in the nights and on most days I only get one LC medium done :( Any tips or advise? I have been preparing for 4 months now and clearly see it's not gotten better if you guys are going to tell me practice will make it simpler. Getting very discouraged today :( What am I doing wrong? No trolls please. TC 250k Yoe 9
2-5 mins...
Then you must be working at Facebook! No?
There are levels of company above Fang...
Depends. Honestly some mediums are easier than some easy for me. I've been stuck on some mediums for hours, and solved others in 5min. It's all over the place.
This^
Some hards are easier than some mediums
Usually takes really long if I cant solve it in first 5 min.
1 minute.
10m
You need to start looking for pattern when solving the problems. There are only a few major patterns that work for like 80%+ of problems (easy, medium and hard). It should only take you the time needed to type out the solution for problems you’ve seen. For new problems that fit a known pattern, maybe add 2-5 min to that. Otherwise, it’s a crapshoot for time.
Neat advice thanks much can you please share patterns which can work for 80% problems or please share your framework I know it would have taken lot of hard work to arrive at the same
Just off the top of my head. Master DFS and BFS. Like, be able to visualize the flow in your head. Memorize the code for each so you can type them out without thought (the code is very short). When solving the Leetcode DFS and BFS problem see when to use either. Dynamic Programming is just DFS + memorization. Backtracking is just DFS + pruning. Generating permutations/combinations/etc is just DFS/BFS + saving state. The list goes on. Binary Trees and methods to traverse them (preorder, inorder, postorder) are seen a lot too. Same for binary search trees and the ways to find relationships among nodes (lowest common ancestor, is balanced, etc) That should get you most of the way. The rest are smaller patterns that work on much fewer problems (like string manipulation or palindrome). Just do the tagged problems on Leetcode until you’ve seen enough where it’s likely you’ve seen the problem and solution if it comes up in an interview. For more obscure questions, hopefully prep in the above will have sharpened your problem solving skills. It’s the luck of the draw, so if you get these, don’t beat yourself up if you mess it up. You can also just memorize top asked Leetcode questions for the company that fall into this category.
10-15 minutes for ones I haven’t seen
10-15min? Does this mean typing out the solution and submitting and all tests passing? Or just knowing the solution before you start typing?
Have you done all the initial prep first ? Quickly going over DS and Algos ? Take some time to look at each DS and Algo and just thing what they give you and where you think they might be useful & write it down. I was kind of in the same boat and my problems were and still are : 1) if I don’t solve it myself then I’m worth nothing, looking at a solution is a non-starter 2) I tend to go to a more complex example to start with 3)I go down the rabbit hole preemptive optimization 4) I end up solving and implementing some hard problems in 20mins now and the and then reinforces my bad habits because performance outliers have no real value when preparing for a interview loop. I’ve got better at sticking to the algorithm to approach coding problems but bad habits die hard. The average of performances is really what matters My advice would be: 1. Take 2-3 days and revisit DS and Algos but look at it from a more practical application perspective. Think about what information or utility each one provides directly or indirectly. Think of the applications as a jigsaw puzzle with the core DS/algo being the “instructions”. 2. Timebox yourself, you don’t get more than an hour to solve a problem. If you are close to a solution give yourself another 15 mins tops. If not, stop. Pencils down. Take a few mins break doing something else to disengage your brain from your current line of thinking and then look at the solutions, understand and implement them. 3. Do not preemptively optimize when preparing. Get your time down to 15-20mins for brute force first. 4. Have a timer to snap you out of any rabbit holes you’ve got yourself in 5. Not all mediums are actually mediums. Leetcode does have most down right but there are problems which are hard or easy that is labeled as medium I also suggest the Blind 75 problems as a point to start. It’s a whole range and get that done first. When solving (even BF) give yourself - a good 5 mins to just read and sit with the problem. - Take another 5 mins to go over examples, start with base cases and increase the difficulty (unlike morons like me). - Take 10 mins to come up with a solution and some quick pseudocode - Take 10-15 to implement the code - Take 5 mins to test (use your example test cases) It’s a whole process and you will not meet this time limitation when you start trying to time yourself, it’s normal, join the club! It will get better as you continue to work on problems and you start to see patterns more quickly. To start with, expect to suck and be ok with it. So then every single that improves is good feedback. Build on it. On days I follow my own advice I do better like getting solution done and tested in 20-40 mins depending on the problem. The easy ones should not take more that 15mins from start to finish. Some harder problems are again outliers. It’s going to take time and it is going to be hard to stick to it so don’t beat yourself up. Just try the next one.
10 min max to think + 5 to code and submit = 15
A poll would be optimal