Reflecting on seven years as the top technology executive at Uber Technologies Inc., Thuan Pham divides his time there into three “tours of duty,” as he describes them. One was expanding Uber from a novelty service in three dozen cities to one that serves millions of customers around the world. The second was a scandal-pocked period in 2017 culminating in the ouster of his boss, Travis Kalanick, and a lasting rift between the two men. In the third, Pham helped Kalanick’s replacement take the company public, but they stood divided behind the scenes over at least one key issue.

The war ended with Pham’s resignation last month as Uber faces a new and protracted crisis brought on by the coronavirus pandemic. In his first interview since stepping down, Pham described “battle scars” from his time at Uber. He said his decision to stay at the company after Kalanick’s exit drove a wedge between them that remains to this day. Pham, 52, now walks away from Uber with concern over the company’s autonomous-driving strategy.

In a video call from his home in San Jose, California, Pham said he’s relieved to no longer be responsible for the technology that powered some 18 million trips a day before the pandemic. “It is a very heavy burden,” he said. “I have a little PTSD setting in right now.”

Pham’s willing embrace of unemployment sets him far apart from the 6,700 former colleagues who lost their jobs last month. He gave notice a week before the first of two large rounds of job cuts eliminated about a quarter of Uber’s workforce. More than 40,000 tech jobs in the U.S. have vaporized since the pandemic began, part of an economic crisis that has left millions of Americans without work.

Uber, like the rest of the travel industry, has been hit hard by the virus. The pandemic decimated the ride-hailing business and left millions of drivers without an essential source of income. Uber’s food delivery unit is an exception, and demand has risen. The company is now in talks with Grubhub Inc. about a potential acquisition that would create the largest food delivery operation in the U.S. If the deal happens, Pham said, integration of the two companies will be difficult and the key to its success.

In an emailed statement, a spokesperson for Uber wrote, “Thuan never shied away from expressing his opinion while at Uber, including when he disagreed. We always valued his candor and perspective, and we wish him all the best.”

Pham’s path to chief technology officer at Uber reads like a Silicon Valley fairy tale. As a child, he escaped war-torn Vietnam in 1979 on a refugee boat with his mom and younger brother. They settled in Rockville, Maryland, where Pham spent middle school learning English and discovered computers in high school. The finality of programming appealed to him. “After I code it, I never have to do it again,” Pham said.

Pham got a coding job in high school at the U.S. Commerce Department. From there, he attended the Massachusetts Institute of Technology and earned bachelor’s and master’s degrees. He headed straight to Palo Alto, California, for a job at Hewlett-Packard. Through booms and busts, he found his way to Silicon Graphics, DoubleClick and VMware Inc. before Kalanick came calling.

When Pham joined Uber in 2013, the company was doing 30,000 rides a day and quickly outgrowing its technical capacity, resulting frequent system crashes. Pham’s first job was to architect an entirely new infrastructure. Then Kalanick wanted him to make it work in China. The company’s domineering co-founder gave the team a two-month deadline.

They worked 80 to 100-hour weeks setting up servers in China that adhere to local data storage laws, while fielding daily pressure from an impatient chief executive officer. “Travis simplified everything,” Pham recalled. “He said, ‘Why is this taking you guys so long? I can go to Fry’s and buy several thousand machines, stick it on an airplane and go over there.’”

For the launch, Kalanick insisted on starting with the city where Uber was seeing the most demand from customers, Chengdu. “Here is part of the Travis quirkiness but also brilliance,” said Pham. “Normal people, you and I, would think ‘Let’s start with the smallest one first.’ He said, ‘Give me the biggest one first.’ After that, the engineers had that sense of confidence. If we can tackle Chengdu, we can tackle any other city in China.”

By 2017, any quirky charm associated with Uber’s methods turned noxious. Pham professed ignorance of the many scandals that would draw unfavorable headlines and the attention of the U.S. Justice Department. A system used to evade law enforcement called Greyball was adapted without Pham’s knowledge, he said, from technology his team built for special promotions involving on-demand kittens and ice cream. For other projects with similarly foreboding names and intentions: “I didn’t know until I read about it.”

Pham said he was shocked and saddened when he read a blog post that year by a software engineer in his division named Susan Fowler, claiming harassment by her manager and a pattern of sexism in the organization. Fowler had said at the time she reported the allegations to the CTO. During this period—Pham’s second tour of duty—the board investigated those incidents and determined Pham wasn’t at fault. As for Kalanick, major investors decided Uber would be better off with him gone.

Kalanick and Pham were tight. Pham considered leaving then but decided to stick around to provide stability for employees. “For me, it would have been better to back off and let everyone else handle the mess,” Pham said. “But the company is about more than just him. It’s the blood and sweat of thousands of people. I didn’t want it to collapse like Enron.”

In Kalanick’s eyes, the decision to stay was “a betrayal,” Pham said. They haven’t spoken much since. “I think he’s still hurt,” Pham said. A spokeswoman for Kalanick declined to comment.