SAN FRANCISCO — The new chief executive of Uber loves his parents, does not love President Trump and has successfully managed a consumer internet company in the face of fierce competition. Uber’s board, shareholders and employees can only pray that is enough.

After six months of extraordinary turmoil at the ride-hailing company, its board late Sunday selected Dara Khosrowshahi, the 48-year-old chief executive of the travel site Expedia, which confirmed the choice on Monday in a letter to employees. Mr. Khosrowshahi would succeed Travis Kalanick, an Uber co-founder and the driving force in making it the world’s most valuable start-up, who was forced to step down in June as the company was rocked by one scandal after another.

Mr. Khosrowshahi’s task will be to repair the internal culture, which had moved beyond the usual gung-ho start-up attitude to rampant divisiveness and harassment. He must also steer a course that defends and extends Uber’s brand while preparing for a self-driving future that many other companies would like to dominate.

And he will have to do it under a much brighter spotlight than he has worked under before. Uber’s repeated stumbles have made it a public drama like few others in Silicon Valley’s history. Finally, there is the issue of Mr. Kalanick, who might seize on any trouble to mount a comeback.

Mr. Khosrowshahi was the dark horse candidate whose name did not slip out until he had the job, so his virtues and faults are little-known. Expedia is based in Bellevue, Wash., which makes him a Silicon Valley outsider. While Mr. Khosrowshahi had not commented as of Monday morning, here is one yardstick to size him up: he was president of his high school class. He was not, in other words, divisive.

At the same moment in June that Mr. Kalanick was noisily being ejected from his company, Mr. Khosrowshahi had a little problem of his own. Glassdoor, a site where employees rank their companies, released its 2017 list of the top chief executives. Mr. Khosrowshahi’s score, for whatever reason, had dropped.

His parents weighed in with that combination of celebration and criticism that many immigrant children know well. As Mr. Khosrowshahi reported on Twitter, his mother said, “Nice! You made the top 100!” But his father pointed out: “#39 is good but you were #11 in 2015.”

Lili and Gary (short for Asghar) Khosrowshahi were prosperous members of the Iranian elite in the 1960s and 1970s. Gary was an executive at an industrial conglomerate, where he worked with relatives. They all had to flee Iran in 1978 as the government of Shah Mohammed Reza Pahlavi collapsed.

They made it to Tarrytown, N.Y., and lived with relatives. “For the grown-ups, it was a difficult transition,” Dara Khosrowshahi told Bloomberg Businessweek this year. “The kids were able to party together, so it was fun.”

Four years later, Gary went back to Iran to take care of his ailing father, and he was detained for six years before he could return. Lili had to bring up three children by herself.

Hadi Partovi, Dara’s cousin, said in an interview that “his mom raised him to be direct with people. By far the biggest challenge he faced, which is what all of us faced, was having to come to a new country and assimilate. Being an Iranian in America in the 1980s was not pleasant. People were singing ‘Bomb bomb bomb Iran.’ ”

But the tense environment also pushed them to succeed. “Every one of us cousins had a chip on our shoulders, having lost everything to the new Iranian government,” Mr. Partovi said. “We had a desire to build anew as entrepreneurs.”

And they did. Mr. Partovi is an investor in Facebook, Dropbox, Airbnb and, as it happens, Uber; Dara’s brother, Kaveh Khosrowshahi, is a managing director at the investment firm of Allen & Company; another cousin, Farzad “Fuzzy” Khosrowshahi, played a major role in the creation of Google Docs; yet another cousin, Avid Larizadeh Duggan, is a general partner at Google Ventures.

Mr. Khosrowshahi, in fact, did so well that in 2015, he was the highest-paid executive in America as calculated by Equilar. Thanks to a large stock option grant, he made $94.6 million. In 2016, without the grant, his pay was $2.5 million.

Mr. Khosrowshahi, in addition to running Expedia, has been on the board of The New York Times Company since 2015.

Interactive Feature | Interested in All Things Tech? The Bits newsletter will keep you updated on the latest from Silicon Valley and the technology industry.

His route to success took him to the investment firm of Allen & Company, where he spent most of the 1990s as an analyst. Barry Diller was a client, and Mr. Khosrowshahi decided he wanted to work for the media mogul. So he did.

In 2001, Mr. Diller acquired Expedia, a travel booking site founded by Microsoft. Four years later, Mr. Khosrowshahi became Expedia’s chief executive. The site has flourished, acquiring three major competitors in 2015 alone. Shares in the company, which is now publicly traded, have risen 35 percent over the last year, despite competition from Priceline on one flank and Airbnb on another.

“If Dara does leave us, it will be to my great regret but also my blessing — he’s devoted 12 great years to building this company and if this is what he wants for his next adventure it will be with my best wishes,” Mr. Diller said in a note to Expedia employees on Monday.

Uber, like Expedia a decade ago, has enormous promise but also faces enormous peril. Mr. Khosrowshahi’s supporters believe he can fix the underlying problems.

“He’s a global travel executive — he understands competitive dynamics, geopolitical challenges, and the operating challenges of running a sprawling global travel company,” said Brad Gerstner, founder of Altimeter Capital, an investor in Uber as well as Expedia.

Under Mr. Kalanick, some Uber executives were considered untouchable, which contributed to a poisonous atmosphere. Shana Fisher, who worked with Mr. Khosrowshahi at Mr. Diller’s IAC and is now a venture capitalist, said, “People don’t get an excuse with Dara. They have to be good and good. Good and good. He doesn’t have tolerance for less than that.”

One immediate problem for Mr. Khosrowshahi: The lawsuit filed by Google’s self-driving car spinoff, Waymo. Uber is accused of stealing Waymo’s intellectual property.

Mr. Khosrowshahi has clashed with Google before. In 2013, Expedia was one of the companies that filed an antitrust complaint against Google in Europe. Last month, Mr. Khosrowshahi acknowledged that Google was a significant adversary for Expedia.

“They are a competitor for the consumers’ hearts and minds when they have a travel question,” he told The Financial Times.

Mr. Khosrowshahi’s experiences as an immigrant gave him a personal perspective on the executive order that President Trump signed restricting travel from seven predominantly Muslim countries this year.

Expedia, along with Amazon, became one of two technology companies to contribute early declarations to a lawsuit filed by Washington State’s attorney general objecting to the travel ban. Mr. Khosrowshahi described his early experience as an immigrant in an email to employees.

“We sure didn’t feel like refugees, but in hindsight I guess we were — my father and mother left everything behind to come here — to be safe and give their boys a chance to rebuild a life,” he wrote.

He has expressed other pointed concerns in the wake of Mr. Trump’s election. In February, he concluded a conference call with Wall Street analysts by saying, “Hopefully we will all be alive to see the end of next year.” In March, Chelsea Clinton was named to the board of Expedia.

On Aug. 15, Mr. Khosrowshahi tweeted: “I keep waiting for the moment when our Prez will rise to the expectations of his office and he fails, repeatedly.”

Lili and Gary are clearly watching their son rise to their own expectations. After he was interviewed by Jim Cramer, the host of the financial TV show “Mad Money,” in May, Dara tweeted: “didnt screw it up (according to mom).”

From now on, not only will his parents be watching, but just about everyone else as well.