Shaffa44, Duolingo mixes up between Standard and some dialects. If we follow Standard Grammar, "coffee" should be in the nominative case, as the "khabar" خبر. Hence, the ending sound is with Damma.
But, in the dialect that Duolingo have chosen, the Damma ending sound in the nominative case is not recognize. The case applies only -ak (for 2nd-person masc. sing.) and -ik (for 2nd-person fem. sing.). Whether they are in the nominative, accusative, or genitive cases -- all are the same.
Nb: your GOOD question has been downvoted by someone who doesn't understand! :(( ... I don't know why some people like to downvote something that is nice. So, I give you an UPVOTE! Keep learning :))
Shaffa44, you're correct! Since Duolingo uses some dialects, the "k" sound is always dead (in sukuun) so the sign of the gender is taken from the "-ta" (for masc.) or "-ti" (for fem.) sound. However, ... in Standard Grammar, it should be tu (because it is in the nominative case). The gender (masc. or fem.) is determined by -ka كَ (for 2nd-person masc. sing.) or -ki كِ (for 2nd-person fem. sing.).
Nb: AAfHJ8, your good question got a downvote by some random user! I give you an upvote :))