NEW YORK — Martin Shkreli got his first taste of Wall Street as an intern for a hedge fund firm started by CNBC personality Jim Cramer. After striking out on his own, he developed a reputation for aggressive tactics, including betting a company’s stock price would fall and then berating its executives on social media.

His battles earned him a spot on Forbes list of “30 under 30” after, the magazine said, Shkreli torpedoed a health care industry merger and “antagonized” pharmaceutical giant Pfizer into removing its former chief executive from the company’s board of directors. Shkreli, now 34, is a “boy genius,” his attorney has said.

But one of Shkreli’s most aggressive moves changed that narrative, when as chief executive of Turing Pharmaceuticals he raised the price of Daraprim – a 62-year-old drug primarily used for newborns and HIV patients – from $13.50 to $750 a pill. When critics pounced, the live-out-loud Shkreli did not do his reputation any favors by calling a journalist a “moron,” quoting defiant rap lyrics on Twitter and defending the price increase as a “great business decision.”

“Our shareholders expect us to make as much money as possible,” he said during a health-industry summit in 2015, dressed nonchalantly in a hooded sweatshirt and sneakers. “That’s the ugly, dirty truth.”

These two narratives of the Brooklyn native are playing out in federal court this week as Shkreli faces eight charges that could land him in prison for years.

Packed into the second-floor courtroom in Brooklyn, several potential jurors said they had already formed strong opinions of Shkreli. One potential juror told U.S. District Judge Kiyo Matsumoto that Shkreli is “the price gouger of drugs. My kids are on some of these drugs.” “I know he’s the most hated man in America,” another said, while another asserted that “From everything I’ve read, I believe the defendant is the face of corporate greed in America.” All were excused from the jury.

Shkreli sat a few feet away by himself, intermittently appearing to write on a yellow pad or staring up at the ceiling. Dressed in a gray suit and no tie, he yawned and leaned his head against his arm to stay alert. The trial is slated to last four to six weeks, and Matsumoto told potential jurors it “promises to be interesting and educational.”

Federal prosecutors alleged that for five years, Shkreli lied to investors in two hedge funds and biopharmaceutical company Retrophin, all of which he founded. After losing money on stock bets he made through one hedge fund, Shkreli allegedly started another and used his new investors’ money to pay off those who had lost money on the first fund. Then, as pressure was building, Shkreli started Retrophin, which was publicly traded, and used cash and stock from that company to settle with other disgruntled investors, prosecutors contend.

Shkreli’s attorneys are preparing to argue he was following the advice of his attorney, who is also facing criminal charges. His investors didn’t lose money and were not defrauded, they have argued.

“Shkreli did not defraud the investors and then make it up to them later with a different investment. This may be the Government’s view, but it’s not ours,” his attorney Benjamin Brafman said in a court filing earlier this month. “At trial, the defendant will show that Mr. Shkreli never, at any time, intended for a single investor to lose a dime. Not in the short term; not in the long term; not ever.”

Shkreli’s emergence on the national stage coincided with a larger debate about rising drug prices and Shkreli appeared to relish the attention, or at least not shrink from it. Even after he was arrested in December 2015, he spent hours on YouTube chronicling his life for fans and was eventually kicked off Twitter for harassing a freelance journalist. When he appeared before a congressional committee last year, he smirked and grinned while refusing to answer questions. Afterward on Twitter, he called the lawmakers “imbeciles.”

Even after his attorneys urged him to stay quiet, Shkreli repeatedly took to social media. In April, he offered $40,000 to a Princeton University student who solved a mathematical proof. In May, he pledged on Facebook to pay $100,000 for tips leading to the arrest of the person who killed former Democratic National Committee employee Seth Rich.

Shkreli is “traveling to the beat of his own very unique drummer,” Brafman has said.

When Shkreli asked this month for his $5 million bail to be reduced to $2 million, his loquaciousness worked against him. Brafman told the court that Shkreli didn’t have any cash and needed to pay taxes and legal fees.

But skeptical prosecutors noted that Shkreli had bragged about his wealth, including flaunting that he had paid millions for a Picasso painting, a one-of-a-kind Wu-Tang Clan album, and a World War II-era Enigma code-breaking machine used against Nazi Germany.

Those statements should not be taken seriously, his attorney responded. “Tweeting has become, unfortunately, so fashionable, and when people tweet, they don’t always mean what they say,” Brafman said.

The judge denied the request.