Interviewer here on Blind, Did it happened to you that candidate came up with a solution you didn't understood but might be correct. Like there are some coding questions can be solved with one liner with mathematics or using advanced DS. How do you react in such situations. IMO non experienced interviewer will simply reject the candidate as the solution is not what they expect?
Ask to solve in another way as well. Afterwards validate both solutions
I don't like this. How about ask the candidate to teach you their solution? If the candidate comes up with a good solution the interviewer didn't consider, that's on the interviewer. You don't cry foul and ask a redo just because you didn't do your due diligence.
If you cant understand most likely your team will not be able to. The code may not be maintainable and completely reusable. I agree with above comments, candidate should be able to provide alternative solutions.
I got rejected from Google maps a few years ago when asked about different ways to represent Google Earth data in a database. They wanted to hear. A quadtree representation, which is the first thing I called out as possible. But then I also pitched a modified Z-Order space filling curve which was something I had been using to map data within a DHT. I tried to talk about the pros and cons of each, but he didn't want to hear any other possibilities. I also got rejected from Facebook for a modified subtree comparison leetcode question, where, based on the problem structure (which I did clarify about), I wanted to precompute a hash value for each node, which was recursively dependent on the children. In such a way the subtree comparisons become constant time, at the cost of precomputing the hashes at tree construction time. They didn't like that one bit, despite it fitting everything. I think it foiled follow-up questions that expanded/built off the first one
Every interviewer comes with questions and set of expected answers . That’s how most of the interviewers are
I'd ask you to walk me through it with a few input examples and maybe ask if there are any alternative approaches you considered and if so describe them. I wouldn't ask you to code the alternative. If you could teach me something new plus walk me through alternative possibilities you're probably a slam dunk.
Anytime I see a candidate with a solution I haven’t seen before, I’m vastly more interested. Any interview where I as the interviewer learn something is almost always going to be a hire recommendation.
Just run through test cases with them and make sure that they pass and make sense to you. The point is to be open and learn and reward solutions that work. Edit: take a picture of his pseudo code and spend time after the interview to make sense of it if you didn't get it.