"Do you like my hair?"
Translation:Magst du meine Haare?
German is quite different from English with respect to sentence construction. Where in English we use three words - Do you like to ask such a question, German sentences are constructed somewhat differently: Magst du is only 2 words.
Magst du meine Haare? would translate directly to "Like you my hair?". Of course it does not make sense in English to write like that. Similarly, when you translate from English to German, beware of directly translating a sentence word-for-word.
Hope this helps you, and all the best! :)
The ending of mein- is the same ending you would need for ein- or kein- in the same situation.
You should memorise the pattern: https://en.wikipedia.org/wiki/German_articles#Indefinite_article