News for hackers. Stuff that matters.
Re:Ask HN: How does one have the mindset to study for coding... by fragmede on Sunday June 28, 2020 @09:44PM (#23673608)
And when I'm on Facebook looking at the best part of other people's lives, I compare it to the worst of my life, and get depressed and discouraged. Thing is, other's aren't usually sharing the worst of their lives, so I'm making a comparison that's unfair to me.

It sounds like you are tying up a lot of your self-worth in solving these problems "in 5 minutes", and there a few things to unpack. First off is that "5 minutes" is a drastic exaggeration, and even if it isn't, standard interviews length is either 45 minutes or an hour - you get the full time, to work through the problem. So don't sweat the timing.

Even if you can't solve the problem, no one but you sees your leetcode performance, so just because you feel like you're failing, that's a feeling which is all in your head and it's trying to trick you into giving up. Don't let it. No one is getting hired solely on the basis of their leetcode profile.

(If you've already shared your leetcode profile with all of your friends, and/or feel like having a strong leetcode profile is going to make you a more attractive interview candidate, then make a new username not related to anything else you do online using an anon mail service (eg mailinator.com). Then, if you still feel the need to show off your speed on your leetcode profile, copy and paste the working solution from that username into your 'official' leetcode account.)

Instead of trying to rush through and do 100 problems per day, sit with one problem, for a whole month. Use different algorithms, do different languages, go for runtime speed efficiency, go for memory size efficiency. Use leetcode as a tool to help you.

Another thing to understand is that a large component of interviews is simply luck. There are only so many permutations of sum/sort/median/topN/bottomN/count possible, so during a real interview, if you get a question that's similar to one you've solved before, then a solution comes naturally. What leetcode really is then, is a gameified playground to see a bunch of variations on a theme, in order to raise the chances you see a similar problem during an interview.

Echoing other commenters about the subject of mental health - find a therapist to talk through this and other things with. My life's been better for it, and it absolutely helped me to get my life in the shape it needed to be, in order to get a job at a FAANG company.

There are no comments on this comment yet.