
Feeling ashamed of myself
The interviewer asked me a sorting question: to sort an array in descending order. However, the interviewer specified taking input from the console. Although I knew everything—even if not the optimized code—I could have coded the brute-force solution. But while taking input from the console, I got too stressed because I rarely use console input. I forgot everything due to nervousness and couldn't even code the simple solution. I feel so ashamed.

dont stress yourself out for this, it is normal to be nervous. mindset that i follow is i always explain myself before giving the interview that interviewer is also a person just like me, there is no shame in asking help from him or asking to google for even the basic things as he might have also encountered a similar situation atleast once. good luck

Thanks for the suggestion ☺️

It happens to the best of us, Bro. Even I was getting interviewed by a Senior SMe for a product based company two days ago. My entire mind was on the thought that 'he is an SME, I cannot answer his question' and when He asked me a simple question, I over thought about it and couldn't answer it.
After the interview I felt so silly that I didn't answer such small ques. And I am sure he won't select me for that.

I am not concerned about the end result of my code. In my last interview round, I was asked to find the sum of a subarray, which I successfully solved. But this time is an easy one, I failed right at the beginning.

What language were you using?

Java

So you messed up the input part or the whole thing?
it happens sometimes.

The same scenario happened to me in an interview with a startup.