An interviewer asks why an array list is fast to read at any index. The reason is it allows:
ARepeated hashing
BRandom access
CRapid deletion
DReverse sorting
Answer & Solution
Correct answer: B. Random access
1. Elements sit next to each other in memory.
2. Any position can be computed directly.
3. So it allows random access.
_Source: OpenStax Introduction to Computer Science, Chapter 3, Data Structures and Algorithms._
Keep practising Data Structures and Algorithms
Browse all Data Structures and Algorithms questions for Coding Interview Prep, or explore more Computer Science topics.