Microsoft Interview Question

Code for Reader writer problem.