Upvote:8
No, you do not need a transit visa for either country. This assumes you have connecting flights on a single ticket from the same airport (Istanbul has three) and you don't need to recheck bags etc.
Per Qatar Airways, anybody can transit through Doha, Qatar without a visa as long as they don't leave the airport.
Turkey's transit visa policy is covered here: Do I need a Turkey transit visa for a layover?