Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it correct to ask to solve an NP-complete problem on a job interview? [closed]

Tags:

Today there was a question on SO, where the author was given an NP-complete problem during an interview and he obviously hadn't been told that it was one.

What is the purpose of asking such questions? What behavior does the interviewer expect when asking such things? Proof? Useful heuristics? And is it even legitimate to ask one if it's not a well-known NP-complete problem everyone should know about? (there's a plenty of them)

like image 253
P Shved Avatar asked Nov 12 '09 19:11

P Shved


People also ask

How do you respond to closed interview questions?

Closed-ended interview questions Often, they can be just a "yes" or "no," but you should give candidates an opportunity to explain themselves. These questions can help you quickly gain basic information about the job seeker.


2 Answers

Completely legitimate to me. If you are Computer Science professional there are good chances that you can either argument informally why the problem seems to be hard, or (even better) provide a sketch of reduction from a known NP-hard problem.

Many real world problems eventually turn out to be NP-hard, and stackoverflow also has now and then questions about the complexity of a problem which turns out to be a difficult one (NP-hard, for instance). It is an important part of a CS professionals toolbox to be able to recognize and to argue for problems which are known to be difficult to solve.

like image 176
Antti Huima Avatar answered Sep 28 '22 07:09

Antti Huima


I don't see any problem with asking something like this. Also, programmers should NOT be expected to recognize NP-complete problems by rote. They should, however, be able to identify that their algorithm is potentially slow regardless of whether a given problem is NP-complete.

like image 38
Parappa Avatar answered Sep 28 '22 08:09

Parappa