Let flag=0 & lock=0, then both the processes can enter the CS simultaneously.
So, mutual exclusion is not satisfied.
The implementation of the system is such that once a process make it to its critical section it sets the value of flag & lock such that both the processes can enter their CS alternatively i.e. either P0->P1->P0->P1->......... OR P1->P0->P1->P0->.........
Starvation for a process is possible if the other process that is expected in the sequence is not present.
The solution is deadlock free as both the processes are never simultaneously waiting in the while loop.
So, answer is (A)