IBM Interview Question

Three abstracts scenarios: implement the solution in C