HACKER Q&A
📣 lowiqengineer

How does one have the mindset to study for coding interviews?


I'm considering starting a new job hunt, but I'm out of practice. Unlike most folks, I still haven't gotten into competitive companies after doing ~250 or so problems (perhaps because of my aforementioned IQ leading to an inability to problem solve), and I'm not interested in companies that do alternatives to coding interviews as they generally pay significantly worse than what I'm expecting, but whenever I do Leetcode problems I frequently dive into the depths of depression and self-harm because I often can't do Medium problems. I've done CTCI, but that isn't as effective in the market now.

I'm genuinely concerned I might harm myself further if I attempt more study, but at the same time, I need to fix my compensation trajectory or else I'll be in the same boat later. What do you use to avoid this?


  👤 f2000 Accepted Answer ✓
I lost my software engineering job a year ago. In my late 50s I sunk into a depression. A resource that helped me get back on my feet was the works of Dr. David Burns. His website is https://feelinggood.com. He also has a book "Feeling Good: The New Mood Therapy" and a podcast. In my case the feelings of hopelessness and depression that stemmed from my job loss were due to distorted thinking. For example my thinking was along the lines of "I've lost my job, I'm old, I haven't interviewed in decades so no company will hire me, I'm doomed". In reality that was distorted thinking. Sure some companies might practice age discrimination, but not ALL of them. I may be older, but I also have years of experience. It turned out that after about 4 months I found a job with a better company with a pay increase. There is hope and I hope this comment can help you in some way.

👤 noema
Leetcode interviews are more of a sadistic entrance ritual than anything approximating a fair gauge of skill or experience. I see no other reason to make proven developers study textbook problems during their free time (they sure aren't implementing knapsack algorithms from memory at work).

It often goes unmentioned that these interviews test the wrong skills for software development and even instill bad practices. To wit, those artificially handicapped online IDEs force you to memorize language APIs which any real IDE would handle for you -- forget that the JS lowercase string call is "toLowerCase"? Too bad. Also, since time is of the essence, and no debugging tools are provided, you better be using an interpreted language (read: JS and Python -- and really only the former unless you can import the correct libraries) and littering your code with print statements.

Other companies opt for the ostensibly fairer "take home CRUD app assignment" but this too is a facade to lend credence to a preselected candidate pool. No matter how well you complete the assignment with all enterprise grade best practices, you'll still playing the lottery (and this time with a five hour time sink).

Bottom line is don't interpret a lack of success in this draconian system to a personal defect. Ideally, seek employers who assess candidates fairly and qualitatively.


👤 _alex_
You need to spend some time on mental health. if you need help, get help. either stay at your current job or take a new job that you can get now. in either case you need to figure out how to deal with stress and how to value yourself. if you really are going to self harm when you struggle on a freaking leetcode problem, how do you think it’s going to be if you actually get the job you’re aiming for and it’s hard every day?

👤 ud0
I recently got into one of FAANG & the following are the steps I took to get there:

- Create a study curriculum.

- Each topic in the study curriculum should contain both reading & practice material.

- The reading material tells you about the data structure or algorithm and practice lets your reinforce what you just read.

- Spread this over a long period of time say 6 months.

- Practice everyday, I cannot emphasise this enough.

- Limit to about 2-3 hours a day.

- Give mock job interviews weekly or bi-weekly. See https://www.pramp.com

- Be kind to yourself these questions are hard on purpose.

You will notice a gradual improvement in your problem solving skill and general knowledge about the problem space. You might even begin to enjoy it (that's what happened to me). Diving blindly into just solving problems is a poor strategy. The key is balancing reading & understanding the data structure or algorithm with solving actual problems.


👤 xo-xor
I’m going to echo a few other comments on here and say that, although it may frustrate you to hear, focusing on your mental health is the urgent priority here—-but also, thankfully, something that will have positive side-effects across many domains.

As someone who has struggled seriously with self-harm in the past, this is not just a regrettable by-product of coding problems; this is a significant attempt by you/your body to regulate an environment that feels out of control, to cope with overwhelm, to distract yourself from facing something else—-ymmv, but until you work on understanding what triggers this (just coding? Other things too?), and develop tools for dealing with situations that provoke these intense feelings, this problem will re-occur in one form or another. Essentially, it’s too soon for a focus statement like “get better at leetcode” because the problem statement hasn’t been defined yet. That’s something you (and a therapist and/or workbook, online resource etc, if money is a challenge) can do together.

Now the good news: not only can you address this, but doing so will have amazing and unforeseeable benefits in more areas than just coding. This stuff never fully disappears, but I can now look at a passing thought to hurt myself as a “check engine light”—-it does not have power over me, it occurs seldom, and if it does, it means something needs addressing.

Best of luck.


👤 sciencewolf
You need to figure out _why_ you can't do medium problems. If you can solve easy ones, it means you have the fundamentals down, and probably just need more exposure.

250 sounds like a lot, but I'd also be curious how you do the problems, and why you're having issues.

Where are you getting stuck? Are you looking at the answers immediately? Or are you struggling through the problem, and only peeking at hints as much as is needed to make a breakthrough?

Do you think through and recognize the patterns (two pointer, greedy, dynamic, etc) that are needed to tackle the problem, or are you just jumping into code instantly?

What do you do when you get stuck? Do you confidently ask for help, knowing hints are part of the game?

How's your timing? Are you getting in a brute force solution and an optimized one?

Addressing these concerns will reveal where you need work, and then you can continue to get better without being too affected by your current state. Remember, no one was born knowing how to solve these problems, so you can always get better and reach your economic goals.

Small plug -- we created AlgoDaily (https://algodaily.com) to teach programming interview skills using a visual, patterns-based approach. The lessons on approaching the interview and how to prepare might be especially helpful.


👤 curiousfiddler
I hear you. And there is good advise in the comments, but one thing I'd think you should also explore is your emotional response when you hit the harder parts of a problem. Sometimes, it is not the lack of knowledge or understanding of a subject, but the emotional response (subtle anxiety, anger, stress etc) that hinders progress when you hit an uncomfortable stage in problem solving. To add to it, leetcode and interviews have the added pressure of time limitations.

Observe your emotions - there may be a completely different solution to your problems.


👤 ignorantguy
Solving stupid leet code problems doesn't make you a better engineer. Try putting more effort in learning best engineering practices, read books, blog posts and try to implement them in your current job. Don't over think about compensation. Find a company that has good work life balance instead. Trying for more compensation is fine, but you can do find a much fulfilling job if you try to make yourself better.

👤 armitron
If you don't think there's something seriously rotten with 50+ companies selling "interview preparation" and all sorts of randoms selling you their get-into-Google courses, books and Youtube videos, you're not really paying attention. You should take it as a sign that these parts of the industry are FUBAR and steer well clear. Herd thither, me hither. Stop copying what the pseuds are doing, come up with your own vision and follow it wherever it may lead.

Assuming you're not fresh out of college and have plenty of experience (and skills to go with it), find a job that doesn't put you through this dumb grinder. Odds are it'll be a job you'll actually enjoy doing.


👤 davidajackson
Do as many interviews as you can and you'll start to see the same problems over and over. Treat it more like a fun coding game and think of it less as an interview if you're the type to psych yourself out. Identify what you're weakest at -- be it recursion, trees, systems design and focus on improving in specific areas. You could also create a plot of problem type and measure success/failure and then weight each category based on frequency in order to determine what to study. But it might also be better to take it day by day and not stress to much about the exact results too early on as you warm up.

👤 ornornor
> I'm not interested in companies that do alternatives to coding interviews as they generally pay significantly worse than what I'm expecting, but whenever I do Leetcode problems I frequently dive into the depths of depression and self-harm

Maybe getting a lower salary is very well worth it if it lets you avoid the self harm and depression. SE salaries in general are pretty good so even if you’re in the lower end of the scale it’s decent. Not everyone can earn 300k total comp by working for the usual suspects, earning 80–100k if you don’t live in overpriced cities/countires is still a pretty good life.


👤 strikelaserclaw
i think first of all, solve problems for their own sake, enjoy the process, learn the solutions, that is the surest way to getting better at it (or really anything in life) and getting better as an engineer as well. If your goal is "i want to get good at these stupid puzzles so i can work at google and make alot of money", you will most likely fail. When i first started leet code, i had no competitive programming background, i didn't really even remember any of the algo & ds stuff i learned in college a long time ago, but i kept at it, i used to think about some medium problems for a couple days or more (I knew back then people who had a shot at google could solve medium problems in an efficient manner in like 10-15 mins) but that never discouraged me, even if i didn't get a shot at FAANG or whatever, i knew working hard and thinking about this stuff would make me a better engineer. After 7 months of work, i could solve a-lot of medium problems in around 10-15 mins in an efficient fashion and i actually look forward to solving LC problems whenever i get an opportunity. Other than leet code, i regularly study CLRS (i love this book). I guess my point is, either learn to love problem solving, or apply to places that don't value it because its hard to become good and compete at a high level if u don't intrinsically enjoy something. Don't tie your self worth to your IQ, don't get depressed because you can't do something, i'm sure u have a job, so just keep at it and try different approaches to learning this stuff.

👤 neofrommatrix
Start with this: https://www.educative.io/courses/grokking-the-coding-intervi...

That covers a lot of patterns you can typically use to solve a problem. Keep practicing and don’t lose heart. Use mock interviews to get valuable feedback. You can do it.


👤 djdjdjd
I spend 2,5 month preparing every workday additional an hour and in weekends 10-15h (the whole weekend).

I failed the first phone interview because I was absolutely unable to guess what he was looking for.

2 years later again 2,5 month preparing for it. This time also large system design. I make it to inside. I still not in.

It is emotional stressful. That's how it is.


👤 mraza007
Honestly I would suggest stop looking at LinkedIn or CSCQ subreddit most people are just sharing there wins not losses and theres nothing wrong with that what is not okay is that it makes some people depressed that because we start comparing ourselves and that leads to depression. Honestly just focus on your goal keep motivating yourself

👤 runawaybottle
Just know you are not the only one going through it. I know plenty of multi year developers that have to deal with it, and they walk away wondering if their worth anything. It’s definitely a gauntlet and it’s tough on everybody.

👤 random314
Why are you so motivated by high pay, that you fear harming yourself? Just go for companies with a simpler interview process and attempt FANG after a couple of years of practice

👤 haihaibye
It's not possible for everyone to be at the end of the curve. Be content with what you can reasonably achieve.

If it helps, maybe move somewhere with a better wage to cost of living ratio.


👤 redis_mlc
There's a simple hack for non-FAANG job coderpad interviews.

Just do several interviews in a row to learn what the common questions are. Then memorize those 3 or 4 solutions.

There's been a move this year to fully using the 1 hour coderpad period with a large problem, so you really need to go in with a prepared solution. (Thanks a lot, a(7) interviewers.)

As one of my friends said, "Interviews are a lottery." So do your best, then move on to the next one (see above.) Don't take it personally, just keep improving.

Also, if an interviewer says, "it doesn't matter if it runs or not" or "syntax doesn't matter", assume they're lying and fix it. (Again, thanks a lot, a(7) interviewers.)