IBM interview question

implement custom arraylist in java