You may see a variety of styles in cases like this, and I do not believe that any single style is universally considered the unique correct one. For me, the first one is strictly speaking loose, but is acceptable except perhaps in very formal contexts. I think I would only use the second one when literally quoting a question spoken or written elsewhere.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.