Starvation is possible or not?
The answer is wrong.

Deadlock implies starvation, and the given code suffers from deadlock, here's how.

Say p0 executes wait(S); and then p1 executes wait(Q);. Now both the semaphores S and Q have value = 0.Now p0 will keep on waiting due to statement wait(Q); and p1 will keep on waiting due to statement wait(S);.

Freedom from starvation means that:


  if a thread tries to acquire a lock , it will eventually succeed.


This does not happen here, so the answer is wrong.