In German there are some rules to this:
- All non-living things that end with -e are always feminine. Coffee ends in and -e in German, but is a plant, and therefore living, so that's why the rule doesn't apply. But otherwise it applies fully. (Except that "the end" is "das Ende", and building is "das Gebäude". But still, the exceptions number in one or two. Otherwise all non living words ending with -e are feminine. "Die Straße" for a street. "Die Dose" for a can.
- Everything with -chen is always neutral. This rule is so stupidly strong that even the word for "girl", "mädchen" is not feminine. Girls are not female in German because they end with -chen, think about that!
There are other rules as well, but these two are the easiest ones.
Plus there's the "don't learn just 'das Mädchen'. Learn 'kleines Mädchen'" that I mentioned in another comment above!