
Ask HN: How does one have the mindset to study for coding interviews? - lowiqengineer
I&#x27;m considering starting a new job hunt, but I&#x27;m  out of practice. Unlike most folks, I still haven&#x27;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&#x27;m not interested in companies that do alternatives to coding interviews as they generally pay significantly worse than what I&#x27;m expecting, but whenever I do Leetcode problems I frequently dive into the depths of depression and self-harm because I often can&#x27;t do Medium problems. I&#x27;ve done CTCI, but that isn&#x27;t as effective in the market now.<p>I&#x27;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&#x27;ll be in the same boat later. What do you use to avoid this?
======
f2000
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](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?

~~~
lowiqengineer
weirdly i'm usually fine on the job, I don't feel the same way at all. I'm
generally at ease even.

It's tough, it's like I feel attacked by the fact that I can't solve these in
5 minutes like the other folks I see on Linkedin.

~~~
codingdave
People always show their best side on social media sites, especially LinkedIn.
Trying to measure up to an image that someone has crafted of themselves to get
a job is somewhat like believing that the pictures people post on Instagram
match their daily reality. You are walking into a well-known trap.

Trust me - as someone who listens to coding candidates on occasion, the
majority do not just come in and whip out answers in a couple minutes. Those
people are rare. And we sometimes like the slower candidates better because we
get to see how they think instead of seeing just a quick answer.

~~~
deepaksurti
The genius candidate is one with the quick answer but gives a slow answer :-)

------
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](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.

~~~
duggable
What did your study curriculum look like?

~~~
ud0
I created my curriculum using the topics in the book: Elements Of Programming
Interviews In Python [https://www.amazon.com/Elements-Programming-Interviews-
Pytho...](https://www.amazon.com/Elements-Programming-Interviews-Python-
Insiders/dp/1537713949/ref=sr_1_1?crid=1Y28OPE15QLNJ&dchild=1&keywords=elements+of+programming+interviews+in+python&qid=1593503464&sprefix=Elements+of+pr%2Caps%2C202&sr=8-1)

------
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](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.

~~~
strikelaserclaw
in my experience, easy problems basically test how well u know the language u
code in, they generally involve no knowledge of algorithms or ds. Medium
problems generally involve being comfortable applying algo & ds fundamentals
to solving problems. Generally, u can solve a medium problem pretty easily in
a bad way but u can refine it to whatever degree your skill permits you, they
key here is to understand things like space time complexity of your solution
and seeing if you can refine it

~~~
sciencewolf
I think I'd agree, but my argument is that going from a medium problem solved
"pretty easily in a bad way" to a "fully optimized and efficient way" is
easier than most people think. There's only a dozen or so patterns needed.

As an example, if you know the two pointer technique
([https://algodaily.com/lessons/using-the-two-pointer-
techniqu...](https://algodaily.com/lessons/using-the-two-pointer-technique)),
you're well on your way to solving at least 1/3 to half of array problems in a
performant manner.

~~~
spiffyman
Some friendly feedback: I clicked through to your article about the two
pointer technique and, AFAICT, there's nothing for me to do or read here. It
says "In this guide, we'll cover..." but it's not clear how to actually view
the guide. I'm guessing - without having clicked around at all - that my next
step would be to create an account and visit the page again, but that's not at
all clear to me as an unauthenticated user.

I do see a small "Login" on the bottom right of the page, as well as "Sign in"
and a highlighted "Upgrade" at the top. But there is no CTA telling me what my
next step should be. Maybe users of your site who land on this page will know
what that step should be, but you might want to add some direction for people
who randomly land on it via SEO/SEM or links on forums.

Cheers!

ETA: in a search for some action, I clicked all over the graphic and on a
couple phrases in the intro to see if they would take me somewhere. If you're
tracking clicks, it might be worth looking at whether other users are doing
similar things.

~~~
sciencewolf
Thanks so much for the heads up :-) It's amazing how much of the user's
perspective you miss when you're heads-down in code all day.

I've added some navigational indicators to hopefully make it a little clearer
that you can press the footer buttons or swipe on the screen. Appreciate the
friendly feedback!

------
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.

~~~
dragonwriter
> Solving stupid leet code problems doesn't make you a better engineer.

If companies use it for hiring screens, it does, indirectly: work experience
is the main thing you need to be a better engineer, and the more time you
spend working instead of spinning your wheels trying to get hired...

~~~
ignorantguy
You are right, I totally understand that. The OP is depressed about not being
able to solve medium problems. In that case it is better to avoid the rat race
and try and becoming a better engineer is the best option.

------
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.

~~~
lowiqengineer
Honestly I'm fine on the job and I'm usually not stressed like I am when I do
leetcode. I'd be fine keeping my current gig but the TC increase even if/when
I get promoted is lower than the average Google new grad offer.

------
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...](https://www.educative.io/courses/grokking-the-coding-interview)

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

~~~
lowiqengineer
Yeah, I stopped going on CSCQ years ago because I knew it was just making me
more depressed. Still, I know a lot of successful people personally who
privately believe I'm a failure for working at the FANG i work at so the net
effect is the same unfortunately.

~~~
mraza007
Never think negative it hurts and let those people believe they can't face you
so they'll keep believing. Just Believe in yourself and I always think you'll
do your best

------
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

~~~
lowiqengineer
I currently work at a FANG.

I don't think it's so much the high pay as much as it is that my peers look
down on me because of the FANG I work at. I've practiced for years already (to
fairly mediocre results).

~~~
random314
Take up some volunteer work, change your peers, iq, social prestige and money
are not the key to happiness. You can always leetcode and try to improve but
not at the cost of your mental health.

------
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.)

~~~
boring_twenties
Sorry, but I couldn't find a page named `a` in section 7 of the manual ;) what
does a(7) mean?

~~~
redis_mlc
a * * * * * * _

~~~
boring_twenties
If I'm supposed to feel dumber, it's working.

~~~
gedy
Looks like an (unusual) abbreviation for 'asshole'

~~~
runawaybottle
I thought it meant like 7 anonymous companies (‘a’ being a function that takes
in a param) that he/she had to go through. We’re dealing with a real weirdo
here (or a real a(7)) :p

Sometimes you gotta take the good with the bad.

