Ultimate Software Interview Question: Given an main method which ha... | Glassdoor

Interview Question

Intern Interview(Student Candidate)

Given an main method which has arraylist initialized with

  the numbers 1,4,3,2, in that order, which then prints the array (using a combination of iterators and arraylist.get), print the numbers in order. The iterators and Lists were their own class files, which you were allowed to change. Hard to explain, but the solutions pretty obvious when looking at the code

Interview Answer

1 Answer


I overrode whatever statement it was that printed to, instead of just iterating normally, find the next largest number to print 1-2-3-4. This was one of two ways they looked for, the other of which was overriding an iterator method.

Interview Candidate on Feb 13, 2013

Add Answers or Comments

To comment on this, Sign In or Sign Up.