How do you respond? "Yes"?
If the question "你好吗" ("How are you?" although literally translates to "Are you good?"), you can answer with "好" ("Good"). If you're asked "你是老外吗" ("You're a foreigner?") you can answer "是的" ("I am").
So it usually depends on the verb that was used in the question. Although you often can say "对", which is with “是的" the closest Chinese have to "Yes".
In this specific case, you would likely just answer "吃了" ("I ate") or "吃了,你呢?" ("I hate, what about you?").
Keep in mind that this is more or less the equivalent to"How are you doing?" or "What's up?" in the US; it's a greeting and people aren't necessary expecting an actual answer.