Cisco interview question

Two logic design questions. Implementation of a module that does some task.