This is a common saying I hear on the streets. This is used when someone is not satisfied with one’s own or another person’s actions, sometimes showing misunderstanding about what happened.
怎么搞的 (zěnme gǎo de) carries the tone of blaming or complaining. In English, this phrase would be translated as “What’s going on?“ or “What’s wrong with me/you?“.
Here are some examples to show how this phrase can be used:
1) 怎么搞的！ 明天就开会讨论了，你们到现在还没把计划 书写出来！
Zěnme gǎo de! míng tiān jiù kāihuì tǎolùn le, nǐmen dào xiàn zài hái méi bǎ jìhuà shū xiě chūlái！
[What's going on? We have already talked about having a meeting tomorrow. You still haven't written out your proposal!]
Nǐ shì zěnme gǎo de？ Wūzi nòng de zhème luàn！
[What's going on? The room is so messy!]
Nǐ de jīpiào ne?
[Where's your plane ticket?]
B: 我刚才明明放在桌上的， 怎么搞的， 一转眼就不见了。
Wǒ gāng cái míng míng fàng zài zhuō shàng de, zěnme gǎo de, yī zhuàn yǎn jiù bú jiàn le.
[I just placed it on the table in a very obvious place. What's wrong with me? I turn away and it's now gone.]
刘德联， 刘晓丽. Exemplification of Common Sentence Patterns in Spoken Chinese 汉语口语常用句式例解. Peking University Press, 2005.