Cognizant Interview Question

They asked me to write a program to generate the Fibonacci series using Java. I explained the logic and wrote both iterative and recursive solutions.