Question d’entretien chez FactSet

Given an arraylist, reverse the first n elements and print the entire arraylist.