8 ms·
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?
- neofrommatrix 6y agoStart with this: https://www.educative.io/courses/grokking-the-coding-interview 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.
- ignorantguy 6y agoSolving 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 6y ago> 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 6y agoYou 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.
- jl2718 6y agoAnd honestly, working with people that can’t solve problems in a simple way is a nightmare. Leetcode at least encourages this.
- Nginx487 6y agoDoing push-ups every morning does not necessary for your success. It just helps you stay fit. Same with programming puzzles. It won't help you directly during solving your daily problems, it's just push-ups for your brain.
- deleted 6y ago[deleted]
- cutty 6y agoJudging by your post history, you should seek therapy instead.
- redis_mlc 6y agoThere'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 6y agoSorry, but I couldn't find a page named `a` in section 7 of the manual ;) what does a(7) mean?
- redis_mlc 6y agoa * * * * * *
- boring_twenties 6y agoIf I'm supposed to feel dumber, it's working.
- kylemurph 6y agoa-hole
- gedy 6y agoLooks like an (unusual) abbreviation for 'asshole'
- boring_twenties 6y agoHa you're obviously right. Did you deduce that on your own? I think I immediately excluded that from the set of possibilities because well... why wouldn't they just write asshole?
- strikelaserclaw 6y agoi 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.
- sciencewolf 6y agoYou 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 6y agoin 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 6y agoI 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-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.
- davidajackson 6y agoDo 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.
- armitron 6y agoIf 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.
- _alex_ 6y agoYou 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?
- spiffyman 6y ago> when you struggle on a freaking leetcode problem 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.
- _alex_ 6y agoI could have worded that better. my point is not to minimize the stressful situation, it is that the stress isn’t going to end when leetcode is done.
- lowiqengineer 6y agoweirdly 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 6y agoPeople 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.
- f2000 6y agoI 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.
- haihaibye 6y agoIt'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.
- deleted 6y ago[deleted]
- ud0 6y agoI 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 6y agoWhat did your study curriculum look like?
- ud0 6y agoI created my curriculum using the topics in the book: Elements Of Programming Interviews In Python 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 https://www.amazon.com/Elements-Programming-Interviews-Pytho...
- ornornor 6y ago> 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 6y agoHonestly 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.
- curiousfiddler 6y agoI 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.
- djdjdjd 6y agoI 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.
- xo-xor 6y agoI’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.
- noema 6y agoLeetcode 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.
- random314 6y agoWhy 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 6y agoI 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 6y agoTake 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.
- runawaybottle 6y agoJust 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.
- mraza007 6y agoHonestly 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 6y agoYeah, 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 6y agoNever 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