I have been doing leetcode hard questions for practice. I generally quickly think up a solution, and get it programmed with minimal errors. But often I am getting non-ideal runtimes, and the given solutions are faster. Things like mine being N^2 rather than their NlogN ones. I usually realize that there is a faster method, but can't exactly figure it what the trick is. How often does the first solution you actually code up match the suggested solutions?
Leetcode hards are impossible. I think I’m too stupid. I’ve been leetcoding for 4 months straight already
I like the idea of putting a leetcode hard problem in my head and just thinking about it. I don't have time to sit down and actually spend time leetcoding. So far I've only tried this with one problem, which I started yesterday, the LRU cache in constant time. Really interesting. Great to think about. So far I've managed to figure out the requirements for doing it in constant time, but not sure how to actually write it yet. Can easily think of several implementations for linear time though. Even though it's in my head I've maybe only spent 15 minutes here and there really thinking about it. Not sure you could do one of these in 30 minutes without practicing algorithms a lot for maybe a few months before interviewing. And having the experience in advance of that as well.
Getting LC hards first attempt, 20 minutes ish is good enough to get top 200 or so in weekly contests.
Nice! i always struggle In contests, ive been getting better
Tech Industry
8h
919
I haven’t done shit today!
Tech Industry
12h
2858
Avoid teams with only Chinese or Indians especially with a Chinese/Indian manager
AMA
Yesterday
3797
I’m a professional coaster AMA
Tech Industry
Yesterday
38817
Worried that our top performer is an attrition risk. How do managers handle this?
Tech Industry
2h
647
Google vs Meta vs Apple vs Amazon
Dig into the algos, and practice them seperate of lc. After enough lc problems the solutions become clear. Sometimes there is no effecient solution
I spent 12 hours a day leetcoding though, im so burned out. It took me a few days to get comfortable with dp problems and a few weeks to retain it. I would also practice on the white board, google docs, pen and paper, and always talk out loud to myself. Timing yourself is helpful as well
Where are u now?