when we use DEPENDING ON, the memory is actually allocated for the maximum length.
Whatever the interviwer told to you was true only. But, not every time you load the full length of the dynamic array. Whenever the depending variable gives you some value then depending on that value only array will be loaded. Ok.