HANOI, Vietnam — She wore a pink outfit and matching high heels as she toured the dusty construction site. Soon after To Linh Huong’s visit in April, photos that captured the moment went viral on the Internet, but not because of Ms. Huong’s sense of style.

The daughter of a member of the Vietnamese Communist Party’s Politburo, the country’s most powerful political body, Ms. Huong had only days before been appointed the head of a state-owned construction company. Commentators on the Internet expressed outrage that someone so young — she is reported to be 24 — held such a senior corporate post.

“Taking a little girl who just graduated from journalism school and making her the director general of a construction company is no different than making a one-legged man a soccer goalie,” read a comment on Pham Viet Dao, a popular blog by a Vietnamese writer of the same name. “Sorry to say — this is so stupid.”

Like the Communist Party leaders in China, Vietnam’s political mandarins are struggling to reconcile their party’s message of social justice and equality with the realities of an elite awash in wealth and privilege. The yawning divide between rural poverty and urban wealth has become especially jarring, now that a decade of breakneck growth has come to an end, dimming the prospects for the poor and middle class to fight their way up the social ladder.