Linked lists are ubiquitous in programming, hooking up a library every time you need a linked list is as same as using some library for loops. Sure, you can get some fancy loops with guards and Duff's device built-in, but in some fields of programming you will be laughed out of the job if you ever try to do this.
Heck, I'm pretty sure I could teach pointers to someone who has only worked in matlab occasionally by cut-and-pasting others code in less than 30.
And teaching someone something new during an interview and seeing if they can understand it and then turn around and use it is far more valuable for interviewing the types of people I want to hire than asking them random questions they could find the answer to on google in less than a minute.
void delete_nodes(struct node n) {
if (n.next)
delete_nodes(n->next);
free(n.next);
}
like that?You seem to suggest that there's a wide variety of linked list implementations whose existence you agree with, so at least you agree that some programmers should be making linked list implementations.
(a simple struct for your linked list isn't really the implementation for the linked list operations. obviously in C you would define your own next pointer. i seriously doubt this guy had trouble with that part of it.)