Pergunta de entrevista da empresa Autodesk

Q: Linked List vs. Array. Q: What is blue screen of death in Linux ?

Resposta da entrevista

Sigiloso

19 de jan. de 2017

Q: Linked List vs. Array. My Answer: Inserting a new element in an array of elements is expensive. The size of the arrays is fixed. Linked list provides dynamic size and ease of insertion/deletion. Standard Answer: 1. It's easier to store data of different sizes in a linked list. An array assumes every element is exactly the same size. 2. It's easier for a linked list to grow organically. An array's size needs to be known ahead of time, or re-created when it needs to grow. 3. Shuffling a linked list is just a matter of changing what points to what. Shuffling an array is more complicated and/or takes more memory. 4. As long as your iterations all happen in a "foreach" context, you don't lose any performance in iteration.