"Past Perfect"
Had you worked? – Ты работал?
When had you written the letter? – Когда ты написал письмо?
He had finished his work by five o'clock and went home.
When they arrived I had finished my work.
Peter had gone away when they reached the castle.
" Past Perfect Continuous".
Had you been working?
Had she been working?
I was very tired when I got home. I’d been working hard all day.
We’d been playing tennis for about half an hour when it started to rain heavily.
I was disappointed when I had to cancel my holiday. I’d been looking forward to it.