Virginia Gov. Charles S. Robb ended months of speculation today by reappointing Harold C. King to head the state's powerful Department of Highways and Transportation.

King, 57, a former federal highway official, was selected by former governor John N. Dalton, a Republican, in 1978 to head the department that spends more than $1 billion a year on road construction and maintenance. There had been considerable speculation that the Democratic Robb administration would replace him.

His tenure here has been fraught with controversy because of charges of conflict of interest that led to the resignations of three members of the state highway commission and allegations that he was ineffective in dealing with the state legislature. He had recently come under attack in Northern Virginia for his role in pressing for a route for the proposed Springfield Bypass that was opposed by Fairfax County officials.

King was one of Dalton's chief lobbyists when the 1980 General Assembly increased the gasoline tax from 9 cents a gallon to 11 cents a gallon, but he played a minor role in helping win approval of new highway taxes this year.

Robb also announced the appointment of Carolyn Jefferson Moss as director of the Office of Minority Business Enterprises, replacing John B. Harris.

Moss, 35, is president of a consulting firm in Washington, and recently was a consultant to D.C. Mayor Marion Barry in assessing the impact of federal budget reductions. She was born in Charlottesville and earned undergraduate and graduate degrees from Howard University.