I don't think there is a limit. I have failed 8 times in a short span of time. Turns out the 9th time was lucky for me. You can fail an interview for any number of reasons. I failed the first two interviews because of insufficient preparation. The third interview because I missed reading about trie data structure. Fourth because I was too nervous. After this my confidence was shattered. I was out of control. I couldn't focus on solving problems anymore. I kept asking myself what's wrong with me?. I had this chronic problem of suffering in interviews especially the whiteboard ones. The fifth interview was going all well when I accidentally compared two custom objects without a custom comparator. My heart raced out and I fucked up the rest of it. The sixth one, I prepared well but I gave the best possible textbook answer right in the first attempt. It involved xor lists and linked list manipulation. In my defence I just saw the solution that morning on a coding website and memorised it. The interviewer thought that I got the question from the previously interviewed candidates and rejected me since I was not being honest. (That's what I assumed since I gave a perfectly efficient answer with full working code) I was rejected again. The seventh, well I was in a pretty bad state mentally. Could not even answer basic questions which I already knew. I cried myself to bed that night. I realised that I was expecting too much too soon coming from a non cs background. I took up Gym. I started working out which made me so physically exhausted that I stopped studying algorithms altogether. Then I got the call for eight interview. I prepared for a week, brushed up the basics. But the interviewer decided to ask me a hadoop scaling question which was perfectly reasonable. I came up with a solution but it was too late. I took over an hour but I couldn't write a working code. I got confused with the multiple nested loops. This time I was not dejected. I came home. Watched some TV. Ate my favourite food and continued my routine from next day. I took a vacation the next month and I was incidentally in Hyderabad around that time. My friend from college told me that he got hired by Amazon for SDET. He got another mail that day from the same HR inviting him for a recruitment event for SDE in Hyderabad by mistake. I told him to send me the details of HR. I mailed the HR, told him that I was in the city for a few days and was available to take an interview if he would invite me. He sent me an invite. I went to the interview the next day with ZERO prep. I was pretty sure that I am going to fail here too. But I was now used to it. I realised I have nothing to lose really except a day off my vacation. To my surprise, the interviews went really well. Even the system design questions for which I had not prepared at all, could be solved by me pretty quickly. I completed all my rounds of interview. The HR asked me some details regarding my current role and sent me off. A week later, I receive a call from Amazon stating that I was hired and would receive my offer soon.
I could have simply stated that there is no limit to the number of times you could fail at an interview in companies like Amazon. If you get rejected once, twice , thrice or maybe even eight times like me, it does not mean you are not worth it. It just means you have to keep working harder. I learned from my mistakes, kept no hopes on the result and focused completely on the interviews. As a result I found myself more confident and relaxed. There is no component of luck. It is purely your hard work that defines you. You cant get lucky for interviews in companies like Amazon. They have a proper procedure to weed out a bad hire. I read somewhere that the job of the recruiter is to weed out the bad hires, not take in all the good ones. So they might still reject a good hire based on perceived notions for that day. You have to believe you are one of them and move on with life. You can always try again.
All the best.