How is दरवाज़ा a masculine noun? How to differentiate masculine and feminine nouns?
Every noun has a gender in Hindi (like in most Indo-European languages, English being one of the exceptions). There is no foolproof way to know the gender simply by looking at the word. However, you can make some guesses. For example, most nouns with ा-ending are male and most nouns with ी- ending are female. Similarly, nouns of a certain category often share gender (for example, names of rivers are often female). All these thumb rules have exceptions though.
The best way to go about is to learn every new noun with its gender when you first encounter it. For example, learn मेरा कुत्ता, मेरी बिल्ली instead of just कुत्ता, बिल्ली which will tell you that कुत्ता is masculine and बिल्ली is feminine.