Explain how an ArrayList works in Java. Then calculate the average time complexity of inserting n new items into an empty brand new ArrayList.
- The explanation of how an ArrayList allocates memory (25%)
- The expanded mathematical calculation of the cost of insertion over time (25%)
- Mathematical and order notation simplification (25%)
- Correctness of the final O notation and the grand conclusion (25%)
Vlad is a software architect at Lionside, a Bay Area gaming startup. He asked me this during an interview.