A. Who has given you ice-cream?
B. By whom were you given ice-cream?
C. By whom was you given ice-cream?
D. Who had given you ice-cream?
In such case who will change into by whom.
Rule :
By whom + subject + (was /were) + V3 + other agents.
A. Who has given you ice-cream?
B. By whom were you given ice-cream?
C. By whom was you given ice-cream?
D. Who had given you ice-cream?
In such case who will change into by whom.
Rule :
By whom + subject + (was /were) + V3 + other agents.