GlobalLogic Interview Question

data structure question in js