Based on that text specifically, all that's needed is that the patient and hospital each have a doctor ID column. How many would get it if you specifically pointed out that they need to consider real-world circumstances in this, and / or if you enumerated all the requirements?
Many many many times, when stating a hypothetical question, real-world handling responses are not desirable to the questioners. If the interviewee realizes this, they also realize that they risk losing points no matter how they answer: answering based on the specified requirements fails with you, but answering based on real-world uses fails with people testing against over-engineering / people religious about specific answers to specific questions. And being verbose risks both groups, based pretty much solely on the interviewer, of whom they have effectively no knowledge.
Or have you done this, and it just wasn't included in the example above?
But if it's not, you might be artificially deflating some fantastic people because a) they guessed wrong, and b) you're not aware of your implicit expectations. Be aware, it's in your best interest in many many ways.
You'd either end up with the same employee or hospital records listed multiple times with different doctor ids (lots of repeated data), or with a field in each employee or hostpital record containing a list of doctor ids (searching by or joining on doctor id requires less simple SQL).
I would think the obvious answer to someone familiar with relational databases would be the OP's expected answer - normalize all three tables, then use junction tables to enable many-many relationships.
What am I missing?
What you're missing is that the question-as-stated does not necessarily reflect the real world. The real world does need junction tables. A fully-correct answer to the question-as-stated does not. Change the nouns to anything you desire; the stated problem remains precisely the same, but for this interviewer the answer is different. But not for all interviewers - some do want answers off only what was stated, not off what baggage our language and culture applies to those words.
The question is an artificial, massively-simplified hypothetical problem. What was removed in simplification cannot be inferred with accuracy unless it is stated, and depending on the interviewer, there is always a risk that your answer, however accurate, may be "wrong". It's a guaranteed loss (statistically) for the person being interviewed, and thus most likely for the interviewer as well.
the way interviewers flip between "real world answer" and "assume X, Y, Z, Q, P, R don't exist answer" drives me batty. Write a union of two sets ? Sure. x.union(y). Oh now its "hypothetical" time, right lets break out the pointers..
Without explicit context, how is the interviewee to know which the interviewer wants? They risk a lower review score no matter how they answer.
With that said, many developers (other than database developers) really do not need to understand that. They don't need to understand it because they will normally have a good DBA/database developer that handles that part for them. In fact, large projects may have many specialized DBA roles including Architects focused specifically on schema design.
Database specialists usually end up with very specific knowledge of a particular platform, for example Oracle where there are endless ways to tweak for performance, or replication or whatever. Modeling with RDBMS is usually very straightforward and ends up being only a minuscule fraction of what you do day to day.
If you are looking for someone to do schema design, that damn well better be in the job description given to candidates before they apply, and your software engineers damn well better be compensated for the extra required skill.
I tend to ask questions more about database internals, but it's a crucial job for an engineer to understand how to get performance and integrity for their queries.
Sometimes times you may get world-class DBA/DBE (my current employer is one of those places) who can do an engineer's job (in terms of tuning the queries, etc...) but that is really an engineer's job.
For a DataWarehouse, you probably want to de-normalize the DB if you expect good performance when calculating those cubes.
the relational term would be relation, please stop interviewing ppl for jobs you are not qualified
"Junction", "join table", "intersection table" - really, you are going to judge someone's competency based on which flavor of a synonym they use?
Despite 45 years in IT and a good 25 years of relational databases, I don't recall having heard (or read) the term "junction table" in a technical discussion. A cursory Google search indicates it may be recent terminology from the Microsoft corner of the universe.
Why downmod him so?
Probably because many here don't like someone badmouthing another over something so small.
Something like: "You're tracking doctors, hospitals, and patients. Doctors can see multiple patients, and doctors can staff multiple hospitals". All I'm looking for you to say is that you'd put junction tables between the main entities.
It's so, so crucial that developers understand the basics of database design, and normalization is a huge part of that.