"Hast du ein Hähnchen?"
You can use it for both, although I usually use 'Hähnchen' (or 'Hühnchen') for a (whole) chicken that is about to be eaten and 'Huhn' or 'Henne' when really talking about the animal. If you really want to say chicken meat you say 'Hühnerfleisch' (whereas 'Hühner' is the plural of 'Huhn')
English is a little special in this regard, which has to do with the aristocracy speaking French, while the workers in the field spoke English (anglo-saxon).
Duolingo's usage in this one puzzles me. I grew up in the home of my German grandparents and they used "Hahn" for rooster and "Huhn" for hen. The diminuive (there are several in German) would denote either a baby chicken (peep) or a pet chicken. In fact I used to have a children's book in German which told the story of a visit to the farm in rhyme. The verse I remember went:
"Meine Huhner, seht mich ahn! Bin ich nicht ein feiner Hahn?
Shoener Federn seht ihr nie." Ruft foll stolz der Kikerikee.
Und die Huhner geben zu:
"Keiner ist so schoen wie du."
(My hens, look at me!. Am I not a fine rooster? You'll never see such fine feathers," proudly calls the Cockadoodledoo.. And the hens reply, "No one is as fine as thou." Forgive the mispellings; I can't add in the umlauts. But the way Duolingo uses Huhnchen leaves me with the queasy feeling that someone is eating either their cute little fluffy yellow peeps or their dearly loved pets, although, of course, during WWI my grandmother's family did eat their pets to survive.
I looked this up now because all I knew was that we do use it for chicken we eat but I wasn't actually sure why we use the diminutive. So apperently 'Hähnchen' (like in 'Backhähnchen' = roast chicken) is always a chicken that is slaughtered before it can reproduce, meaning rather young (about 7 weeks old), that's why it's handled like a little version of a chicken, although it's of course not a hatchling anymore. (Note that 'Hähnchen' although it's the diminutive of 'Hahn' meaning rooster, is also used for female chicken)