I haven’t seen that answer it in the comments yet so: to me the closest thing to WTF in mandarin would be “什么鬼” (Shénme guǐ). It could literally be translated as “What ghost” or “What monster”.
You could hear someone say “这是什么鬼”(Zhè shì shénme guǐ) for “WTF is that”. One day I was wandering in a small suburban shopping mall in tier2 Chinese city and a little girl, who was apparently not used to see western faces, shouted “什么鬼” when she first saw me.
So this expression can fit pretty well as the closest equivalent of WTF in Chinese.