For some questions when I am practicing on leetcode, I don't get it accepted on the first attempt. It will take maybe another extra try or two because there are some bugs I did not anticipate. I think in a real interview, this would be analogous to an interviewer suggesting a test case that breaks the code. How bad is it if I don't come up with these "breaking" test cases on my own, but I can debug it appropriately? I am ofc speaking with regards to interviews at big N/unicorn companies like Uber, Lyft, FB, Google, etc
Flaws are expected, and you should be able to fix them. If you catch them without help that's a plus, but it's okay to be prompted.
Depends on the bug, if say semi colon is missing it’s fine but on the flip side say u forgot to change a pointer or something basic then u get -ve points . I got feedback from google that there were some issues in code one of them loop variable being off by 1😂. That costed me my interviews
As an interviewer, I really don’t care about small typos. However, if the bugs happen because the code is not clean or elegant, or if the candidate cannot come up with test cases that catch all bugs, I’m likely to give a no-hire decision.
Even for a single bug? I usually look for the optimal solution and whether they're testing for corner cases and such. If they miss a case or two, I usually point it out and see if they'll fix it without making a kludge of their code.
What if you happen to give one test case that it fails on (and then they fix it), but it works for all the other cases that they try?