← Amazon questions

Find size of private ArrayList using getItem

Filed under Amazon

Given a class containing a private ArrayList and a public method getItem(int i) that returns the item at index i or throws an exception if out of bounds, determine the size of the list using only this…

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Amazon questions

Collected from public candidate posts and coding forums. Updated Nov 2026.