The Hungarians
Modern Hungarians are virtually undistinguishable from their Austrian and Slovak neighbours in terms of Y-chromosome haplogroups.
But Hungary is a notoriously difficult country for Y-DNA proportions. Percentages tend to vary widely from one study to another, depending on the regional populations sampled. Some studies have found over 60% of R1a in Hungary, although the average if half that figure. Some villages have a small percentage of CentralNorth Asian haplogroups N, Q or C, but they are otherwise quite rare. Interestingly neighbouring countries like Austria, Slovakia and Ukraine appear to have more C, Q and N than Hungary.
Hungary has a peculiar history due to its geography - a vast plain surrounded by mountains on every side (the Alps and the Carpathians). In Neolithic times, it was at the centre of the Danubian cultures, which was composed of E-V13 farmers from Thessaly and I2 hunter-gatherers (soon converted to farming). Then came the Slavic invasion (around 3,000 BCE), followed by the Proto-Italo-Celts and Alpine Celts (2,000 BCE to 200 BCE), who brought respectively R1a and R1b to the region.
Hungary was named after the Huns, who invaded Europe from 370 CE and partly settled in the Pannonian plain (now known as Hungarian plain). It isn't sure where the Huns came from, but it is generally believed that they descended from the Xiongnu peoples of Mongolia. They were a confederation and included various ethnic group under Hunnic leadership. It is likely that there were many R1a peoples (e.g. Scythians) from the Eurasian Steppe. The Huns themselves may have been an admixture of haplogroup Q and C. However less than 2% of the modern population belong to Q and C combined.
The next invaders were the Magyar, a Finno-Ugric people who arrived in Europe in the 9th century, and settled in Hungary in the 10th. Hungarian language is actually a descendant of Magyar, not Hunnic, despite the misleading name in "Hun-". The Magyar came from Central Asia, and are related to the modern
Bashkirs of Russia. Modern Bashkirs have about 35% of haplogroup R1b1b2, 26% of R1a, 17% of N1c and 13% of R1b1b1. However, they were conquered by the Mongols, which may account for all the haplogroup C. In fact, the presence of C in Europe is usually attributed exclusively to the Mongols, and C is almost non-existent in Hungary anyway.
A
study compared the Y-chromosome of the Madjar tribe from Kazakhstan to the Magyars of Hungary, and found that some G lineages were related. The article doesn't specify the subcalde, but G1 is the dominant strain in Kazakhstan, and is also found in Hungary (but normally not elsewhere in Europe).
Another
study compared the Y-DNA of Hungarians with other Finno-Ugric-speaking populations in order to understand why modern Hungarians have so little of the typical Uralic haplogroup N1c. They tested a few individuals from a 10th-century cemetery found out that half of the individuals belonged to N1c. The sample was small, and maybe "pure" Magyar, but it nonetheless suggests that the original Magyar had much more N1c than modern Hungarians.
The Magyar population is thought to have suffered considerably from the 13th-century Mongol invasion of Europe, and from the 16th-century war against the Ottomans. Hungary was repopulated in great number by ethnic Germans/Austrians, which explains why modern Hungary is closest to Austria for its Y-DNA composition.
From all this can be deduced that the original Magyars were an admixture of N1c and R1a (predominant), with some G1, and maybe some R1b.
As haplogroup Q is neither associated with the Magyars not with the Mongols, it must be either be of Hunnic origin, or from other Asian tribes part of the various invaders from the steppes.