4 ms·
> Can you guess what the most common methodology people chose was? > Did you guess an XML document? If that is your most common experience with asking that qu
by shadowfox 6y ago
> Can you guess what the most common methodology people chose was?
> Did you guess an XML document?
If that is your most common experience with asking that question, maybe it is time you consider whether you are communicating what you want properly to your candidates.
- shaftway 6y agoThe real WTF was probably the hiring agency that the hiring manager insisted we go through. I'm pretty sure they were coaching their candidates, but we couldn't break away from that agency for some reason (cough kickbacks cough). The answers were suspiciously similar. But I don't know how much better I could have described what I wanted: "I want a class for holding a queue of items in memory. The queue will only need to hold a few thousand items, and you don't need to worry about persisting it in case of a power failure or anything. The only wrinkle is that when an item is added to a queue it has a priority. Higher priority items need to come out of the queue before lower priority items, but items with the same priority should come out in the order they were inserted."
- WWLink 6y agoI don't get it either. How did they suggest using an XML document to act as a priority queue? I actually would have found that highly amusing! My naive contribution: A linked list with pointers to the tails of various priorities. The grabber just points to the head and pops things off the top as it goes.
- shaftway 6y ago> How did they suggest using an XML document to act as a priority queue? I actually would have found that highly amusing! I tried. It got tiring. Sometimes people would loop through all possible priorities plugging them into an XPath query and pop the first element of the highest priority that matched. Some would do two XPath queries, one across all nodes to get the max priority and a second to query the first element (ignoring the lack of a need to run the query a second time at all). Some would insist that XPath has some function that would let you select a node with an attribute that has the maximum numeric value. I'd have been fine with your solution.