Boils down to "How do I know which gender is this word?" the answer to which is either "Memorize all the stuff" or "Get an intuitive feeling by using many times"...
You just need to know the equivalent latin letter and type that. Once I discovered that I finally started getting things right.
You can either add a Ukrainian keyboard (why not?..) or transliterate to Latin alphabet like @yomaster19 said. Unfortunately we have no idea what transliteration is correct because this is implemented by the Duolingo itself, not the UkrDuo team. A lot of transliteration gives a "You have a typo" error for no reason (for example, "Tak, dim tam" for "Так, дім там" says there's a typo in every word which is incomprehensible).