Remove the comma from sentence 1 and they're both grammatically possible. Neither is natural, though. Why don't you stick with the standard "Do you want ...?"?
Interestingly, there are two different interpretations of that sentence. On one interpretation, "what you want" is an embedded question, and on the other it's a free relative clause. So far in this thread, it has been assumed that the speaker doesn't know what the speaker wants, but knows that it is one of two things: a cookie or a cake.
Another interpretation is that there is something defined in context as "what you want" in the sense "the thing that you want." Perhaps the interlocutor has just pointed to a mysterious-looking confection in a display case and said, "I want that." The speaker doesn't know what that thing is, but has two hypotheses about it: it's either a cookie or a cake.
For an analogy of the syntactico-semantic difference discussed in Post #4, consider how differently "what he said" is interpreted in the two examples below. A more natural formulation of (a), it should be noted, is "Did he say that he was sad or that he was mad?"
(a)Was what he said that he was sad or that he was mad? (b) Was what he said surprising or unsurprising?
In (a), the speaker doesn't know what "he" said, but knows that it was either the one thing (that he was sad) or the other (that he was mad). In (b), the speaker may or may not know what "he" said. The question is whether it possessed the quality of being surprising or the quality of being unsurprising.
If you have a question about the English language and would like to ask one of our many English teachers and language experts, please click the button below to let us know: