Implement a nested object validator | Applied Intuition Interview Question