The reason we test for things is to verify you have enough domain knowledge to "look it up". A bad interviewer will ask you to write quick sort on the board, because if we've already gotten to the point of "implement quick sort" yeah we can just look that up. However, if you're given a collection of nodes and asked to do something with them; that's a bit more interesting. If you know nothing about graph traversal, or have never seen a tree (both not uncommon in people claiming to be principle engineers in my industry) how do you even know what to search for? Best case is you're smart and waste time coming up with a new solution from first principles; most likely it just never gets done.