Frequently 吗 is used (instead of an affirmative–negative question affirmative–negative questions) when the person asking the question expects the answer
to be ‘yes’.
(Situation: Seeing a friend getting out of a new car, you ask him if he has just bought a new car.)
你买新车了吗?
Nǐ mǎi xīn chē le ma?
Did you buy a new car? (You bought a new car?)
(An affirmative–negative question 你买新车了没有? would not be proper in this context since there is a strong indication that he did.)
[1] Yip, P. C., Rimmington, D., Xiaoming, Z., & Henson, R. (2009). Basic Chinese: a grammar and workbook. Taylor & Francis.
[2] Teng, W. H. (2016). Yufa! A practical guide to Mandarin Chinese grammar. Taylor & Francis.