Vrbo Interview Question

They asked basic OOP questions and a couple Data structures questions. For example, "Explain a use case where you would use a linked list instead of an array."

Interview Answer

Anonymous

Jul 18, 2016

Arrays are generally for situations where the number of elements are fixed at the time the array is created and/or where random element access is needed. Lists are for when the number of elements varies over time. Linked lists in particular useful when the list is traversed only in one direction (vs randomly accessed) and/or insertions/deletions are frequent. It is very easy to add/remove elements from a linked list (other elements do not need to be moved around).