Answer:
1. She had undergone heart surgery.
Negative: She had not undergone heart surgery.
Interrogative: Had she undergone heart surgery?
2. You had gone.
Negative: You had not gone.
Interrogative: Had you gone?
3. They had designed software.
Negative: They had not designed software.
Interrogative: Had they designed software?
4. I had prepared for a quiz competition.
Negative: I had not prepared for a quiz competition.
Interrogative: Had I prepared for a quiz competition?
5. My elder sister had written a diary.
Negative: My elder sister had not written a diary.
Interrogative: Had my elder sister written a diary?
6. The bag had cost 10 dollars.
Negative: The bag had not cost 10 dollars.
Interrogative: Had the bag cost 10 dollars?
7. The farmer had cultivated crops.
Negative: The farmer had not cultivated crops.
Interrogative: Had the farmer cultivated crops?
8. It had rained heavily.
Negative: It had not rained heavily.
Interrogative: Had it rained heavily?
Hope this helps. :)