I've conducted my fair share of interviews, so I can tell you this isn't uncommon.
When the interviewer gives you a problem:
- First, make sure you understand the problem.
- Second, make sure you understand your solution.
- Third, start coding.
Too many candidates get these steps out of order - that leads to corner cases and bugs. Believe me - interviewers notice candidates who do those steps in the right order.
While you're solving the problem:
- Talk through your solution. Keep talking.
- Tell the interview that at your job you'd use libXYZ.
- Tell her you'd profile performance and see if you should use a different approach.
- Mention if there are inputs that would cause your function trouble.
- Are you nervous? Tell them you're nervous... they won't fail you for that.
An interview isn't about "gotcha! found an off-by-one error! you fail!" or "you forgot to check for socio-pathic user input, you fail!" (Some probably are, and those are bad interviewers... let it slide).
It is about evaluating your solution. It is about evaluating your problem solving process. It is about how you handle it when the interviewer says "are you handling an empty list properly?". There's a lot of important information that comes from an interview (face-to-face or phonescreen), so learn from this experience.
Remember that the interviewer has seen this question before, they know the corner cases. They're pointing them out to move you closer to the solution or see if you understand them, not rub your face in failure.
Jeff Atwood recently blogged about coding during phonescreens [again]. He (like many others excluding Tom Cabansky :P) concluded that it was an incredibly useful tool to pare down the applicant list. Like it or not, it's here to stay.
To the interviewers, use a collaborative tool like Google Docs or I.See[Mike]Code. That's much better than "solve a problem"... "now read it back to me"... don't be a lame interviewer.