Handle invalid input at system level | Meta Interview Question