It cannot. "You don't have cake?" is the correct translation. "Don't you have cake?" would be ״?הלא יש לך עוגה״
P.S: I am a fluent Hebrew speaker taking this placement test by request of a friend wondering if Duolingo's Hebrew course is completely correct.