Ask HN: 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?
54 comments
[ 3.0 ms ] story [ 117 ms ] threadThat 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.
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...
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.)
Sometimes you gotta take the good with the bad.
It's dismaying and shocking to me that such an active HN user would feel free to poison this place as badly as you have been doing: attacking other users, pompously dissing the community while participating in it, denunciatory name-calling...none of this is ok here. If you want to participate in the commons, please stop pissing all over it.
https://news.ycombinator.com/newsguidelines.html
Edit: it turns out we've been through this multiple times before. If you want to continue participating here, it's time to start doing so respectfully.
https://news.ycombinator.com/item?id=23047709
https://news.ycombinator.com/item?id=22859403
https://news.ycombinator.com/item?id=21966283
https://news.ycombinator.com/item?id=21909746
https://news.ycombinator.com/item?id=20490008
https://news.ycombinator.com/item?id=20430846
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.
As an example, if you know the two pointer technique (https://algodaily.com/lessons/using-the-two-pointer-techniqu...), you're well on your way to solving at least 1/3 to half of array problems in a performant manner.
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.
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!
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.
I'm all for the message of "get help if you need it," and it sounds like OP needs the help of a professional, so I upvoted your comment. But minimizing the triggering event is not helpful; the things you see as trivial or unimportant might be insurmountable or critical to someone else.
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.
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.
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.
Honestly, I'd recommend avoiding LinkedIn. It's completely devoid of any personal aspect to the work people do -- it's all business-this, company-that. There's no such thing as a post that's not spun in some positive manner.
As others have mentioned, in short, it's idealized. Plus, the skills that other people have are not necessarily the same skills YOU need to succeed. That includes Leetcode problems. Which, by the way: if the company cares about that kind of thing at an interview, they probably have that same sort of mindset during the job. Not guaranteed, but keep that in mind.
I struggled with impostor syndrome for a good three or four years, despite objective successes in my programming "career" as a student. I think that finding your own value, and distinguishing that from the skills you need to succeed, AND convincing yourself that you can get those skills, is the golden ("growth") mindset.
For example: math. (undergrad CS: calc, etc.) I tell myself I'm not good at math, I struggle adding basic numbers. but I've either 4.0'd or got 90%+ on midterms or just _passed_ enough math classes that I know this isn't true. How? I realized that math is literally just practice. That's it. Work in = work out, and if you get stuck, it's about correcting false assumptions.
That particular realization allowed me to embrace the (honestly terrifying) interview process a bit easier. Leetcode isn't about "grr get this problem perfect otherwise you're trash". Leetcode is about "okay, look, we have 20 minutes to see how good of a programmer you are, here's an intentionally hard problem. how clever are you. how fast are you. and do you fit our mold". THATS IT.
So, what could you do?
First, mindset. I've been doing iOS programming for a good 4 years now, but allll that work makes me worse at Leetcode, because I over-optimize for cases that don't matter. Realizing this made me slightly better at Leetcode. Only slightly.
Remember, Leetcode is just tiny, intentionally hard problems. It doesn't represent your skill as a programmer, just your ability to express a small subset of programming skills. And honestly,getting those skills is hard. I don't have an answer for that. Maybe try to analyze each problem, figure out what it's trying to test you on, then learn that topic from scratch.
Sorry for the ramble lol, hope it was helpful
If you want a Wonderlic type normed test - get in touch.
If it helps, maybe move somewhere with a better wage to cost of living ratio.
- 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.
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.
Observe your emotions - there may be a completely different solution to your problems.
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.
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.
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.
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).