Logical Programming Question For Interview