Group Array By Field Javascript Interview Coding Problems Java