As objectively as I could assess myself (more information below), all the evidence (both subjective and objective) points to a case of stress-induced degradation in performance, and I don't really know how to deal with it.
I'm honestly not trying to find an excuse to make myself feel better for failing. Thank you very much for any help in advance, and I wish you all a merry Christmas and a happy New Year!
## Additional information
I have considered that it's simply because I am not skilled enough, but I don't think that's the case because I always have the problems saved, and when I reattempt the problems immediately after the test:
* I seem to be able to think through the problems much more clearly.
* I can come up with more edge cases that I didn't during the actual test.
* I notice, in comparison, in the actual attempt I would be fussing over too much how variables are named (and often end up naming them worse); whether or not my code was clean (and end up writing super ugly code); and whether or not time and space complexity are optimal (an end up forgetting all about the data strictures and algorithms I know and produce a wrong solution).
* I can often come up with a substantially better (and correct) solution both in terms of time complexity and space complexity.
* I can usually solve each problem within 15 minutes (including time spent on writing the code and testing). Whereas in the actual test I would often spend at least 30 minutes on a simple problem, and then end up writing a brute-force algorithm that's still wrong because I'm running out of time.
* I'm pretty sure the uneasy feeling I had during the actual test was stress/anxiety, not least because I regular do coding challenges and can solve much harder problems
I have also found that mindfulness meditation has helped me put my focus where it needs to be. It's done this in two ways: 1) during meditation, if I feel anxious thoughts, I can act as an independent observer of those thoughts and simply notice them without judging them. 2) During an interview, if I feel anxious thoughts, I can recognize those thoughts as being normal without being overwhelmed by them. Once I do this, I can more easily put them aside so I can focus on doing the best that I can on the task at hand.
We'll ask them about logistics, if they need to be somewhere else, if they mention they came by car we'll confirm they're not parked somewhere where it will be towed. We try and put all conditions so the candidate feels free of other things. In some occasions, they came when we were having a birthday party and they were welcomed.
We try and bring the conversation towards something the candidate is comfortable with, a project they've done or a topic they've worked on. Something that anchors them. We'll ask questions on how they solved things, etc. Then we ease into other problems.
Our sessions feel like we're colleagues trying to tackle a problem together. A few minutes in, they're not stressed and they can actually do some thinking on the issue at hand and do their best.
That's our way to deal with it so we don't rely on the candidate's maturity or confidence levels for the interview to go well. We do that upstream.
...that said, mock interviews or talking to yourself doesn't prepare you for the real thing as well as the actual real thing. The next best thing is to actually go out and interview at every possible opportunity. This can include companies you aren't really interested in.
Is this ethical? I'm not sure. I tell myself if a company can put together a compelling offer, I'm always open to it even if I initially may have no interest in them other than for the interview practice.
Of course, even this is not a fully realistic simulation. You naturally will be more relaxed when you're interviewing at a place that you don't really care about vs. when you're interviewing at a place you really want to join.
Also levels of difficulty varies from company to company too. You'll probably get a more difficult interview at say, a FAANG, vs. some generic Fortune500 non-tech company. That said, I've been thrown leetcode hards at no-name companies.
Here are my two cents based on what I've learned and have been telling my peers (mostly successful also):
The most important thing in any interview is to treat it as a conversation between two colleagues. No one is there to fail you as a candidate (or most of them aren't). They are looking for people to hire as much as you are looking for a job.
As you are looking for a entry-level job, they look specially for people that fit within their culture. Of course, you must know the basics, but most importantly you must be someone ready to talk and listen. Be open to discuss your solutions and other aspects of the code, but managing your time.
From your own self-analysis, I imagine you know the drill of what they expect from code interviews, you know how to solve the questions, and you can see what you could have done better. With that in mind, I have one single piece of advice that I consider the most important one: train interviews.
Before my successful interviews, a friend and I were doing mock interviews basically every single day, for weeks. We really didn't care for the questions, they were mostly easy/medium. What we cared was that they were new and we would focus on how to answer them, how to properly communicate, etc.
I could recommend Pramp but I haven't had any luck there at the time. Find people in the same situation as you, such as friends, and train with them following the "recipe for interviews" to the letter.
That's all, you can contact me if you'd like to talk more about it, email is in bio
Find a friend who will let you do a mock interview with them over a screenshare for 45 minutes. They do not even have to know how to code. Give them a link to the leetcode problem list or similar, tell them to filter the page by I created a small cheatsheet for my friends who did this for me, as non of them were professional programmers. My cheatsheet was essentially Step 1: I will read the problem back to you, probably paraphrased in my own words and then ask you to confirm some assumptions. You can say "yes" to every assumption I ask you. Step 2: I will verbalize my thought process to solve the problem. This may involve writing a tiny bit of code to layout the task, but there should not be much code or any yet. Step 3: I will start actually coding the solution. If I write code for more than 30 seconds without verbalizing my thoughts, alert me. If I'm not writing code but silent for more than a minute, alert me. You don't need to understand what I'm saying or writing, just make sure I am almost always talking. Step 4: I will try to walk through my finished code step-by-step and make sure it works. Again, you don't need to understand what I'm saying, just make sure I'm always saying something. -- One last thing that may help ease your mind a bit. Maybe I've just been very lucky with my interviewees, but I've found that communication skills and being able to lay out very clean code as my final answer is just as helpful as actually being able to quickly solve the problem. I've needed a hint from the interviewer a lot of times to solve my question. Simply asking for a hint is obviously not good, but saying something like "This code won't work in the case where all 3 points make a parallel line, and I'm trying to come up with a solution for that... I feel like there's another way I can visualize this that I'm not seeing right now" is better. Good luck, coding tests suck. But you gotta do what you gotta do.
Create a leetcode account, and practice talking through the problem and your solution. Give yourself 15 minutes to submit a solution. Start with super basic "reverse a string" type questions and go from there.
Once that feels natural, start interviewing at companies- whoever will interview you- take their call. Ideally start with companies you have no desire to actually work for, this should lower the stress / stakes of getting it wrong.
Wash, rinse, repeat until you start getting offers. Then target companies you actually want to work for.
By accepting the worst outcome, anything else will be a step up.