This relates to an answer for this question.
The opinion said that:
Personally, I don’t see much value in coding interviews. The problems I’ve seen asked as coding questions have been (for the most part):
asked by a person who has one specific solution in mind and is unable to recognise an alternative answer or even a better answer (Note: I actually faced this one time - the clown kept telling me I was wrong. For a metaphor of this, see 1 below);
Imagine a coding question to solve traveling salesman in non-polynomial time (a stupid question because it’s not realistic but I’m going for a metaphor here). Imagine, instead, you solved a different NP-complete problem in non-polynomial time and the interviewer wouldn’t accept that solving any one NP-complete problem in non-polynomial time solves them all. If the interviewer lacks the ability to grasp a great answer, then the candidate offering the great answer is filtered out.
I've read in Geeksforgeeks that:
The interesting part is, if any one of the NP complete problems can be solved in polynomial time, then all of them can be solved.
From what I understand, the interviewer gave a TSP problem, to be solved in brute-force approach. The interviewee solved a different problem of the same NP-completeness level in non-polynomial time (maybe using brute-force approach) too. And, literally what I quote from the Geeksforgeeks above.
My questions:
- Is it true that if you solve an NP-complete problem in non-polynomial time, the solution also solves other NP-complete problems as well?
- Are the solutions (in non-polynomial time) for NP-complete problems universal (one solution can be used for all)?
- Why would the interviewee solve another problem instead of the given problem? Or am I misunderstanding something? Is it to show that the approach is universal?
Thank you in advance for your insights.