When Sheryl Sandberg, Facebook’s chief operating officer, walked into the Senate Intelligence Committee’s hearing room Wednesday, it was clear she knew what she was doing. Wearing a simple black suit, Sandberg — author of the feminist bestseller “Lean In” — proved herself to be an experienced political operator. As a former senior adviser in the Clinton administration, she certainly stood out compared with Jack Dorsey, Twitter’s chief executive, who faced senators alongside Sandberg at the hearing.

Both Dorsey and Sandberg have faced internal criticism that they were inattentive to critical challenges during the 2016 election, when Russian operatives, posing as Americans, flooded their platforms with messages intended to divide the electorate — events that set in motion a set of crises that have only worsened since then. Twitter has been taken to task for millions of fake accounts and for abusive trolling, while Facebook is battling public outrage over the misuse of user data by political consultancy Cambridge Analytica.

Sandberg, though, is known as being the epitome of controlled and polished; she excels at public appearances where she can bolster Facebook’s image. In keeping with her reputation, she dove into her talking points as she readily answered questions Wednesday. Dorsey, on the other hand, prefers communicating via Twitter over giving interviews or public speaking. He referred to himself as shy during his remarks, went off script, and repeatedly looked at his phone. His Twitter account sent tweets during his opening remarks.

Their approaches were tested by lawmakers, who grilled the executives with questions about their business models, privacy, disinformation, abuse of their services by governments and foreign actors, and their readiness to prevent that abuse in the run-up to the U.S. midterms. Sandberg and Dorsey’s responses can impact regulation of the tech industry, a prospect both acknowledged during the hearings.

Sandberg “will probably give a master class in crisis management communications,” said Roger McNamee, a Facebook investor who has become a critic of the company. “It won’t matter because they’re guilty.”

Facebook and Twitter declined comment.

Both executives for weeks have been relentlessly practicing for hours of grilling by lawmakers, engaging in role play and panels of questioning by colleagues and hired consultants, according to executives at the companies.

Of the two, Sandberg is more personally embattled. Five senior executives who report directly to Sandberg have departed or have planned to depart Facebook since the Cambridge Analytica controversy broke, including the company’s long-standing general counsel Colin Stretch and Elliot Schrage, who was Sandberg’s most loyal deputy and right-hand man.

Sandberg’s carefully cultivated image is now under attack from within, and employees are publicly questioning her effectiveness as second-in-command to CEO Mark Zuckerberg.

One of the most popular submissions to the company’s town hall last week, in which employees vote on questions to publicly ask Zuckerberg every Friday, was whether there are problems with Sandberg’s leadership, given a recent string of departures among executives who reported to her, a Facebook employee said.

According to two executives, Sandberg was distracted during the run-up to the 2016 election in part because she was promoting her book about grieving, “Option B: Facing Adversity, Building Resilience, and Finding Joy,” about grieving. (She became a widow in 2015 when her husband died of a heart attack.)

One thing is for sure: Scrutiny of the tech industry will continue through the U.S. midterms in November.

“The whole world is keeping score now,” McNamee said. “If something goes wrong in the 2018 midterms that can be traced to Facebook, Google or Twitter, there will be hell to pay.”

Trump’s leading candidate for the Federal Reserve board thinks that the Fed ‘is not your friend’

Judy Shelton’s un­or­tho­dox views underscore how intent Trump is on pushing the Fed in a new direction

These plates deemed portion sizes fit for ‘mom jeans’ or ‘skinny jeans.’ Macy’s pulled the products.

Macy’s responded after a tweet drew attention to the plates

Abigail Disney is fighting for better working conditions at Disneyland

The granddaughter of Disney’s co-founder checked in with workers at the ‘Happiest Place on Earth’ after an employee reached out via Facebook