Вопрос:

4. When I (to meet) Tom, he (to eat) an ice cream which he (to buy) at the corner of the street.

Ответ:

When I met Tom, he was eating an ice cream which he had bought at the corner of the street.