3 ms·
I've asked linked list questions before and here's why I sometimes use them. I don't have a ton of extra time in an interview and I can expect a candidate to b
by fredophile 6y ago
I've asked linked list questions before and here's why I sometimes use them.
I don't have a ton of extra time in an interview and I can expect a candidate to be familiar with linked lists or I can explain the data structure very quickly.
Linked list problems are relatively simple. Candidates are under a fair bit of stress during an interview so simple problems become harder than they would normally be. You also don't have time in an interview to dig into very complex problems. With a linked list I can give a problem that most candidates can work through in the time we've got and then ask follow up questions based on how they approached and solved the problem.
- Salgat 6y agoWhy not write something more practical? For example, have them write a class that demonstrates a few design patterns like dependency injection, has a basic interface it implements (for example, a DrawPixelArray method), that kind of thing. This to me is far more informative about skills the person would be using in their day-to-day job.
- dahfizz 6y agoIt depends on the job, I think. In some positions, it is a lot more "practical" to have a command of data structures and algorithmic thinking than it is to implement fancy OO design patterns. EDIT: A quick glance at OP's profile suggests that they are an experienced C++ programmer. I definitely think being able to handle pointers is more practical/fundamental skill than dependency injection in that context.
- fredophile 6y agoTo be clear, I don't ask them to write a linked list class. I would typically be asking them how they would implement a function that takes a linked list and has to do something with it. A lot depends on who I'm interviewing and what I'm looking for for that role. I don't think there's a one size fits all interview question for programming jobs. In the above example I might only want them to explain how they would solve it to see their problem solving abilities. In other cases I might want to see some whiteboard quality code and we can segue into other topics like debugging or testing the code they wrote. Your example probably wouldn't be suitable for an entry level candidate who I would expect would need more guidance for things like class or interface design but I'd expect to be able to implement functions given an API.
- collyw 6y agoHow many programmers actually need to implement linked lists in day to day jobs? If they are doing that, then they are likely to be over engineering other parts of the system, when there is a well tested, documented library available.
- fredophile 6y agoI didn't say I ask a candidate to implement a linked list. I sometimes ask them to do something using a linked list. Using basic data structures is something I would expect most people I interview to do regularly in their day to day jobs.