Recently I had some interviews at a large company. I failed to get a job offer, but will likely re-apply in a year (their required period to wait). I may also apply at other companies in the mean time. One thing that I know I messed up on was the coding interviews.

There were two coding interviews. One right after the other. As best I could tell, the second one went great. I pretty much have to go on gut feeling because they don't give feedback on how you did on a particular interview. But, I solved both problems in that interview and with enough room to let me do some code optimizations so I don't see how I could have done much better.

The first coding interview was the one I totally bombed. It was a relatively simple problem, but I just couldn't think of the solution. Initially I wanted to get out a O(N^2) solution because that's what came to me first, but the interviewer just kept asking about whether I can make it faster. Eventually I was allowed to code out the solution I came up with first. But then, with way too much assistance on behalf of the interviewer, I got a solution that was more like O(N). And then we ran out of time.

I did quite a bit of practice coding on LeetCode before these interviews, but I'm still left feeling unprepared. The type of questions in these interviews are what I would describe as "not real world", or maybe "college" or "trivia" style. In this case specifically, it was the largest sum contiguous subarray problem. I've been writing software professionally for around 16 years, but that coding is totally different than the skills needed to solve these problems. I'm much more at home coding things like business logic, database access, or UI.

On LeetCode, what I've noticed is that there are some hard level questions that I do find hard, but then there are other hard questions that the solution flows right out and runs correctly without much more than fixing syntax errors. I'm talking like 10 or 15 minutes worth of effort. And on the other hand, I've had some easy or medium questions that take me all day.

When I interview again, I know I'm going to be dealing with the same kind of coding questions. I really feel like my ability to solve them is more of a coin flip rather than based on my skill. How should I be trying to prepare for this? Is it just a matter of more LeetCode type training?

  • It's a tricky reality that some programmers, definitely including elite and highly successful programmers, are just completely crap at coding-interviews and on-the-spot coding. I am totally hopeless, I couldn't make "Hello world" on the spot. (Something of an analogy is that many major musicians, famous singers etc, have absolutely no clue about sheet music and/or music theory.) IMO there's no real solution, other than more and more practice.
    – Fattie
    Feb 6, 2021 at 12:43

2 Answers 2


Leetcode practice will help, but interviewers aren't just looking for you to get the answer correct, they're looking equally at how you approach the problem. I know it's cliche, but it's the truth. You can pass an interview even if you can't answer the question, by having an interesting discussion about the problem with the interviewer.

Often there is a 'trick' to these questions that you need to see to get the answer correct. Talk through your thoughts as you try out different ways of thinking about the problem (maybe dynamic programming, maybe something recursive, maybe there is a different way to represent the inputs and the goal etc.). This will let the interviewer see that you're a strong problem-solver, and that you know what you're doing. If you're doing all that but still missing is the trick, then they can give hints and participate in the discussion without it making you look bad.

What helped me get better at these interviews, was to buddy up with someone (a colleague or friend) and do Leetcode-style questions together. This helps you practice talking about the problem constructively, and 'thinking out-loud'. Maybe you have colleagues at your current job, or friends from Uni that are also interviewing these days?

  • Sadly, I'm not sure I have anyone I could do that with. The other two programmers at work have...how should I say...not very good skills. As for friends from my college days, I do have one really good friend who went through the same CompSci program as I did, but he never wanted to be a programmer, so all he does is system admin stuff and a little bit of scripting. Don't really have anyone else. that I can think of. I am thinking Leetcode is the best solution for me. I'm just hoping it works.
    – Dan
    Feb 5, 2021 at 21:38
  • @dan that attitude will not help you in interviews. Working through practice problems with any of the people you mentioned would be better than working alone, and you can work on your soft skills while you are at it. Just because someone doesn't have the same experience you have doesn't mean they don't have valuable input.
    – C_Z_
    Feb 7, 2021 at 18:10
  • I know my comment sounded bad but, for instance, one of the guys I'm talking about spent an entire year before figuring out all he was missing was a single plus sign in some code.
    – Dan
    Feb 8, 2021 at 15:59
  • Also, I should say I need to keep the fact that I'm looking for a new job somewhat quiet at work. I feel like just the act of leaving is going to burn bridges regardless of how respectful I am about it. My employer just isn't prepared for me to leave and likely never will be.
    – Dan
    Feb 8, 2021 at 16:12

You can practice with other job hunters at https://pramp.com Pramp provides the questions, the shared code editor, and the video conference platform. What I love about Pramp is that I get to practice being the interviewer half of the time, so this gives a great way to compare my performance with the performance of others because I get to see the interview from both sides. In addition to that, providing constructive feedback to each other is part of the process.

You can also practice at https://interviewing.io In that one, you get interviewed by real companies, but the interview is anonymous. Only at the end of the interview do you get the opportunity to unmask your name if you so desire. Also, the platform provides a shared code editor and the teleconference platform they offer is audio-only. With that said, the platform itself video records your screen along with the audio, so either party can review the interview later if they want.

And then, there is craigslist or meetup.com. If you post an ad asking for a technical interview partner on craigslist, that's another way of doing it. Even meetup.com has meetups that specialize only in passing technical interviews. And if there isn't one in your area, you could certainly create one yourself and keep it virtual until the pandemic dissipates. Basically, you have options.

When on Leetcode, focus on the easy questions and then focus on the top "100 questions asked by potential employers". You do not need to practice all their problems.

It is also a number's game. If you interview with enough employers, you're going to increase your chances of finding interviews where you know all the answers already.

Sharpen your Saw

Use the spaced repetition technique with Anki. https://www.freecodecamp.org/news/use-spaced-repetition-with-anki-to-learn-to-code-faster-7c334d448c3c/

Practice coding every day.

Realize that knowing something doesn't necessarily mean that you actually know it. In many cases, when people say they know something, it's because they recognize it or it's because they've used it before, but it doesn't mean that they really know it or still know it very well.

  • terrific tips here
    – Fattie
    Feb 6, 2021 at 12:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .