Tuenti interview question

Write a code, which represents the Iterator pattern!