There's no general rules, you just have to remember... And once you remember that it is "et barn" you'll also know that all compounded word ending in "barn" also becomes et.
But chances are it's "en" if the noun is recently imported (most technical implements are recent imports, ruter/router, svitsj/switch, kløtsj/clutch, fryser/freezer). Just beware of compounded words like "kjøleskap" = fridge, which is "et kjøleskap" as "skap" is neuter.
"Jente" is a feminine noun, and all feminine nouns may be treated as if they were masculine. This means that they have two different declination patterns they can follow, which is why you get two option for the definite singular: "jenta" (f.) and "jenten" (m.).
"Gutt" is a masculine noun, so it only has the one option: "gutten".
Boy is indeed 'gutt' but in this sentence we're using 'gutten' which translates to 'the boy', take a look at https://www.duolingo.com/skill/nb/Basics-2/tips-and-notes for a good reference.
The application introduced et barn as "a child" so you should stick with this wording. They are basically the same but the AI isn't at that level yet.