After a class on data structures and algorithms, a white board interview asking you to invert a binary tree is very different from the same interview when you apply for a job.
The only thing they have in common is "assessing". An exam for a course seeks to assess mastery of the subject matter of the course. An interview for a job seeks to assess skills / aptitude for a particular job.
This.
Moreover, an exam for a course is, to some extent, an assessment on how the course was delivered. And an interview for a job has a much larger scope.