Capitalization doesn't really matter.
This term can also be likened to 'What the shit?' which is more comical and has a tantamount meaning.
The abbreviation of, most commonly, 'what the fuck', though sometimes also 'who/why/when/where the fuck'. When used with an exclamation point instead of a question mark, it becomes an exclamation of amazement, confusion, disbelief, ect.
Both forms are often accentuated with 'mate' or preceded by 'dude'.
It is commonly used in internet chatrooms where swearing is censored.
The 'W' can be used as what, where, who or when, following by the 'TF' which is always 'the fuck'
WTF is usually used with dude or mate
Example 2: Dude, WTF!
Example 3: WTF did that?
Example 3 uses 'who' instead of 'what'