I just finished the Master DSA Interview Course—fantastic material, thank you! I have three questions:
I strongly agree with Alex/Rahul. A few thoughts I would like to add:
Glad you liked the course! As a heads up, a lot of these angles will be prompted of you in top-level interviews - You don't need to bring them up proactively usually. As you mentioned, it's possible that there is no alternate solution.
...is the goal mainly to communicate to the interviewer that we’ve considered those scenarios (and confirm our code handles them), rather than necessarily rewriting the code to cover each one?
The goal of the interviewer is mainly to make sure that you're aware of the edge cases and that you know how to modify the code to handle them. Making you write code to handle all of them would take too much time, and the interviewer would lose signal.
In those cases, are we expected to justify why no such alternate solution is possible?
You don't need a full-on academic proof, but you will need to justify why an alternate solution doesn't exist. Common examples are pointing out that a problem that intrinsically requires sorting can't be better than O(n log n) or how a problem that requires at least 1 duplication or mapping/mirror of the source data can't be better than O(n) space.
How detailed should that discussion be?
Again, you need to play it by ear. Start off with a high-level description that's maybe a paragraph if your verbal speech was converted to text. If the interviewer isn't sold on your approach, they will press you for more details.
How detailed should that discussion be?
I agree with Alex. You need to develop the skill of reading the interviewer's tone and body language. This is easier to do in-person compared to a virtual interview.
There are often 2 or even 3 questions opened in a single DSA interview. So if you are extremely thorough and spend 10 min clarifying edge cases for the first problem, you are robbing yourself of valuable time for subsequent questions.
You should check with the interviewer occasionally by asking "how does that sound?" before diving into something new. That way you can quickly get to the coding if it's intended to be an easy problem