I am looking for best way to handle an interview which is going south. Usually, I follow the standard pattern as
However, there have been times when the interviewer is trying to be very much helpful and throwing out all the hints before letting me iterate on my ideas. The gesture seems helpful at the same time it just doesn't allow you to showcase your thought process. This particular interviewer, basically typed bootstrapped the classes and methods, and tests. Named the input parameters (pretty bad single letter param names). And didn't allow me to even implement the worst case scenario and made me stuck on thinking the optimized solution. I had the solution space O(N) and time O(1) and some more iteration would lead to O(K) and O(1). But it seems some of the interviewer don't want to see you implment anything other that the optimized solution out there. I ended up with no solution at all.
I would like to see whats the best strategy to
I seriously want to seek some answers on this as it has costed me good opportunities and seems to happen more often.