Well, everyone’s right and “no so right” here… If I was in his shoes and asked to write non-ui functions, like breadth-first, my response would be “I’d ask a platform developer to provide the data in the appropriate format, filtered and sorted the way it needs to be, unless you’re interviewing me for a backend position.”
Recruiters, what goes around comes around. You are in a sales position, and someday those decisions to not take one minute to call a prospect back and explain the situation will come back to bite you. People are a required resource for you and in todays globally instant feedback world, treating them poorly will get you fewer and fewer callbacks, and that eventually will end your recruiting career.
Feedback to the candidate should be the cost of his or her time if they’re not hired. You never know when that prospect may be interviewing you.
Potential employees, be upfront and honest with the interviewers. If you don’t think something is within the job specification, speak up.
Understanding of various data filtering algorithms isn’t necessary for someone designing UI, and you should challenge why that question is being asked. If the answer is “I can’t because as a UI designer, it’s outside the scope of my work and/or I’ve never done it”, then say that. Unless the interviewer is a tool, direct but non-confrontational responses should be appreciated. If they are a tool, you should move on sooner than later.