The correct answer is "was bought".
Explanation:
The sentence is in the Past Simple Passive voice. The passive voice is used when the subject (the cake) receives the action, rather than performs it. The word "yesterday" indicates that the action happened in the past.
Here's why the other options are incorrect:
Therefore, the correct sentence is: "The cake was bought yesterday."