President Trump speaks before signing an executive order to reinstate the National Space Council. Hui Chen, the Justice Department’s corporate compliance expert, ended her contract early, citing the feeling that she was being hypocritical asking companies about conflict of interest issues given the president’s own troubles in that area. (Brendan Smialowski/AFP/Getty Images)

As a contractor for the Justice Department, Hui Chen would ask probing questions about companies’ inner workings to help determine whether they should be prosecuted for wrongdoing. But working in the Trump administration, Chen began to feel like a hypocrite.

How could she ask companies about their conflicts of interest when the president was being sued over his?

“How do I sit across the table from companies and ask about their policies on conflict of interest, when everybody had woken up and read the same news?” Chen said in an interview. “I didn’t want to be a part of the administration whose job it is to question others about these precise things.”

Though her contract wasn’t up until September, Chen left the department in late June — then laid bare her reasons in a post on LinkedIn. The post drew attention because of Chen’s position and how blunt she was on the circumstances of her departure.

“To sit across the table from companies and question how committed they were to ethics and compliance felt not only hypocritical, but very much like shuffling the deck chair on the Titanic,” she wrote. “I wanted no more part in it.”

Chen’s leaving is another example of professionals in Washington being unwilling to serve in the Trump administration.

The No. 2 diplomat at the U.S. Embassy in Beijing similarly stepped down last month, then wrote in The Washington Post that he could “not in good conscience be involved in any way, no matter how small” with the implementation of the decision to remove the United States from the Paris climate agreement. Even Republicans have been asking headhunters whether their reputations could suffer permanent damage if they accept jobs working for Trump’s government, and some have rejected job offers.

Chen said she formally started in November 2015 as a full-time compliance expert working on a contract basis.

Though she did not serve as a prosecutor, Chen helped prosecutors assess companies’ corporate compliance programs as the prosecutors made decisions about whether to bring criminal charges. She worked in the fraud section under Andrew Weissmann, who is now working for the special counsel team investigating possible coordination between the Trump campaign and the Kremlin to influence the 2016 election.

Chen said she had long been concerned about how the Trump administration might operate, but she did not leave earlier because she wanted to stay to “see how things really develop.”

In addition to the lawsuits over conflicts of interest, Chen said she became concerned over the firing of James B. Comey, the FBI director, and the withdrawal from the Paris climate agreement. She said no one in the administration pressured her directly to change the way she did her job.

Chen said she told Weissmann in May that she wanted to depart “as soon as possible,” though he persuaded her to stay.until her contract was up Some time later, she said she had a similar conversation with Sandra Moser, who had replaced Weissmann in the fraud section after Weissmann went to the special counsel’s office.

On June 19, though, Chen said Moser approached her again and asked whether she would object to leaving by week’s end.

“I stopped for like two seconds, and kind of broke into a smile and said, ‘No, not at all.’ ” Chen’s last day was June 23.

The Justice Department declined to comment for this report.

Chen had long been active on political matters and opposed to the Trump administration. Her various social-media profiles show her attending demonstrations and feature pictures of her in a “Resist” hat — which has become a slogan for those opposed to the president.

Her social-media posts drew some attention, because Justice Department policies and laws such as the Hatch Act limit what those who work in government can say on political topics, especially when they’re on the job. Chen said no one at the Justice Department ever complained to her about them.

“I was very careful,” Chen said. “I obviously knew about the limitations of the Hatch Act. My belief is if I had actually violated anything, I would have heard about that in a hot second.”

Chen said she will now spend her time “trying to elect candidates who represent the values that I believe in,” and she hopes to speak, write and consult on corporate compliance topics.

Julie Tate contributed to this report.