choose minimum number of M professors in polynomial time in order to design all N course exams
It's a variant of Set cover which is Classical NP-Complete problem.
Here is the problem definition.

Reduction: Take All courses as a Universal set U which you want to cover.
Then make collection of sets $S=\{P_1,P_2,...,P_m\}$ where, $P_i$ is the set of subjects for which a professor $i$ can design a question.
and you can go similarly in reverse direction.

So there is no polynomial time algorithm for your problem unless P=NP.