DataPattern interview question

based on pointers, array, data structure