I'm at a point where I don't know what to do anymore. I've been having tech interviews for the past year, every time I mess up the leetcode style interviews. They are not specifically hard, but somehow I don't make it to the most optimal solution. When the interview is done, I keep thinking about it and then I figure out the optimal solution on my own, and keep thinking why the heck I could not figure it out during the interview. I don't know, it's as if during interviews, my brain capacity operates at 70%, I become super narrow in my thinking, I cannot think comfortably and I'm tense, I really have trouble coming up with a solution and talking to the interviewer at the same time. How do you guys deal with this ?? Is it even a thing or just me ? It's just too frustrating at this point and it really affects my mental health. I just failed the leetcode screening for a MLE position at Reddit, here I have included the problem in this link with my solution and a potential optimal solution for you to get a better idea :
Hang in there friend, if you're getting interviews its just a matter of time. Sometimes you can do everything right and still fail. You just need to make peace with this. Also its really important to realize that your ability to perform in interviews != your self worth != your skills as a SWE.
I suggest doing more mock interviews with friends. Try to find a buddy and give each other mock interviews every n days. Work on your reasoning skills -- truly understand every line of a problem. Can you explain the solution in such a way a non technical friend can understand it? If not then try working on that
How are you preparing for leetcode style interviews? whats your study routine?
It's honestly a matter of practice and finding a friend to practice with helps a lot.
Something that helps me is, you are not supposed to "come up with a solution and talk at the same time", you're supposed to think out loud. Dont frame it as a i have 10 seconds to figure it out and come up with a solution, literally just think out loud.
For example I saw that problem and I would first spend time clarifying it, working thru test cases. Then it helps to just formally lay out the base case/non optimal solution to just spell it out. Then actually verbally talk through your reasoning. Actually tell your interviewer what your first thoughts are, what you dont know yet, ad what you're trying to solve for.
I know this would need a hashset, I think the high level solution would be to do xyz, but I am not quite sure about this and this. I think this is an edge case I would need to account for
You are not expected to explain the solution and think at the same time
yeah I just practice on my own, but I didn't manage to beat that brain freeze in real interviews yet. It's getting better though, I remember last year I just went completely blank at some point during an interview. Now for example, I can come up with a solution, but I feel like my brain is "tense", meaning reflexion is not fluid and I cannot think smoothly (i.e when I need to think, I cannot use my brain lol, as if there's a lag lol). I guess it's performance anxiety. Facscinating phenomenon nevertheless.
First step: Don't beat yourself up. You will have future interviews and careers are long. I have flamed spectacularly out of interviews several times, and my career turned out just fine. The important thing is have grit and patience, especially in this market.
Based on reading this post, mindset seems like the main problem. You have stumbled upon something I've seen many engineers fail to fully realize, which is that interview success is comprised of 2 parts:
Too many engineers focus solely on #1. To get better at #2, watch this video: https://www.jointaro.com/course/ace-your-tech-interview-and-get-a-job-as-a-software-engineer/having-the-right-mentality/
On top of that, I recommend:
Best of luck!
Yeah I'm very careful about exercising and sleep, I think the main issue was the stakes were too high for me, but you're right about having the right mentality, that video is very relevant thank you.
When the interview is done, I keep thinking about it and then I figure out the optimal solution on my own, and keep thinking why the heck I could not figure it out during the interview. I don't know, it's as if during interviews, my brain capacity operates at 70%, I become super narrow in my thinking, I cannot think comfortably and I'm tense, I really have trouble coming up with a solution and talking to the interviewer at the same time.
It does sound like you're getting performance anxiety, which is understandable because the stakes for an interview can be pretty high. I've been in interview situations where the interview will ask me a question, and I immediately freeze up.
How do you normally prepare for interviews? If you can simulate the real interview process as closely as possible during your preparation, there won't be any surprises when you interview. You'll also be able to build the confidence because you'll know exactly what to expect. So, you might try the following:
Try to develop a growth mindset about the whole interview process where each interview provides an opportunity to collect 2-3 things you can improve on to make your next interview go more smoothly.
I know someone who told me they were consistently bombing interviews, but they kept preparing and preparing, and after a year, they were consistently getting offers from companies they interviewed at. They said a big part of it was just always having something to say when they were working through a technical question.