Cognizant Interview Question

How can I create a dynamic array to store values