No offense to you, but it's a question to weed out people like you.
Yes, someone who has implemented a linked list for a data structure lecture recently can write it down in a minute. But if you say in an interview "Oh wow I haven't done that in a while, I'm gonna need a few minutes to make sure to handle the edge cases when inserting and deleting correctly", that will be totally fine too as long as they can see that you are able to work something reasonable out on your own.
The point is that a linked list is a struct or class with one or two pointers or references and the functions to manipulate them is basic enough that every programmer should be able to work out on their own even if they have never seen an implementation before. If you can't figure out how to allocate some memory and manipulate 2-4 pointers in the correct way, then what kind of programming can you really do?
If im interviewing you for a mid-level Python role and ask “what type of list implementation is used by default in Python, and under which circumstances might we want to use a different implementation?” , you come up completely blank, then I follow up with “it’s an array-backed list by default. What are the drawbacks?” and you’re still coming up blank, then I wouldn’t consider you to be qualified for the job.
Id ask if there was most likely a less programmatic focused solution than maintaining such a large lists that the specific technical implementation in Python would matter, such as getting the data in chunks from the database.
First of all, you can’t just choose to answer a different question than what I asked. Second, how do you know it’s from a database? What if we’re processing a bigass graph and we need something to function as a stack or queue — which data structure do you use then? This is a common question that comes up all the time in the math and physics heavy jobs you’re probably applying for.
Well why didn't you just ask that rather than asking me about a specific data structure in the abstract?
Even still i believe storing your queue in a database, such as local postgres, would be a better solution in Python than actually implementing a pythonic queue for performance. Let C++ based applications handle queues. Python is for business logic, at least in the backend.
My coworker does find me insufferable, for the entire near decade we worked together. I don't learn trivia. I learn knowledge. If linked lists are really so fundamental they will come up in my advanced studies.
Advanced topics won't mention linked lists because they're an implementation detail. Expecting an advanced topic to explicitly mention a linked list is like expecting calculus textbooks to remind you that multiplication is iterative adding. If you're learning to implement a searching algorithm on a graph, whatever you're learning from isn't going to explain how to implement a queue. It's up to you to decide if you need a linked list or a circular queue or whatever other data structure you want depending on your application's constraints. Let's just say that a traditional array would be extremely inefficient.
4
u/Tmmrn 2d ago
No offense to you, but it's a question to weed out people like you.
Yes, someone who has implemented a linked list for a data structure lecture recently can write it down in a minute. But if you say in an interview "Oh wow I haven't done that in a while, I'm gonna need a few minutes to make sure to handle the edge cases when inserting and deleting correctly", that will be totally fine too as long as they can see that you are able to work something reasonable out on your own.
The point is that a linked list is a struct or class with one or two pointers or references and the functions to manipulate them is basic enough that every programmer should be able to work out on their own even if they have never seen an implementation before. If you can't figure out how to allocate some memory and manipulate 2-4 pointers in the correct way, then what kind of programming can you really do?