"Onun pastası yok."
Translation:He does not have a cake.
Why do you think it would be "pastasın"?
pastası: his cake (pasta + -sı)
pastası yok: he does not have a cake ("his cake does not exist")
pastasın would be "you are a cake."
onun pastası yok - he does not have (a) cake
onun pastasın yok makes no sense
pastası onda değil - he does not have his cake
yok talks about existence or possession, not identity - your sentence would be Onun pastası değil.
I still don't understand why it's not "He does not have THE cake". As i understand to make it a specific cake you put it in the accusative case, but you also do that when its the object, so how would you say "he does not have the cake" then? Someone kind of answered that above but they didn't explain why and i don't understand.