In a video of the session, Gates revealed that at two separate meetings Trump needed help distinguishing HIV, short for human immunodeficiency virus, and HPV. The latter is a sexually transmitted infection also known as human papillomavirus that is responsible for causing genital warts or cervical cancer.
"Both times he wanted to know if there was a difference between HIV and HPV, so I was able to explain that those are rarely confused with each other," Gates said as the audience erupted in laughter.
According to the show's host, Chris Hayes, Gates had been speaking to Gates Foundation staff at a meeting earlier this week. The foundation could not be reached for comment.
During the meetings, Trump also asked "if vaccines weren't a bad thing because he was considering a commission to look into ill effects of vaccines," Gates said.
The philanthropist, whose foundation has long supported and funded vaccine research, was quick to respond.
"I said, 'No, that's a dead end. That would be a bad thing, don't do that,'" Gates recalled.
In the three-minute-long video, Gates also discussed a time when Trump met his daughter, Jennifer Gates, at a "horse show thing" in Florida. Jennifer is an "accomplished equestrian," according to Business Insider.
About 20 minutes after talking to Jennifer at the event, Gates said Trump reappeared in style, flying in on a helicopter to the same place he had just been.
"So clearly he had been driven away, but he wanted to make a grand entrance in a helicopter," Gates said, mimicking the flight path of Trump's helicopter with his hand, eliciting another round of laughs.
Gates added that his daughter came up in conversation when the pair first talked.
"It was actually kind of scary how much he knew about my daughter's appearance," Gates said, looking slightly uncomfortable. "Melinda didn't like that."
At the end of the clip, Gates couldn't resist poking a little fun at the president's habit of referring to himself in the third person.
He described the first sentence Trump said to him when he walked into their meeting.
"He said, 'Trump hears that you don't like what Trump is doing,' and I thought, 'Wow, but you're Trump,' said Gates, pointing his finger at an imaginary Trump, a perplexed look on his face.
As the video of Gates circulated on social media, many perceived his comments to be a roast of the president.
On Twitter, one user wrote "Bill Gates out there owning Donald Trump like he was headlining the White House Correspondents' Dinner."
Another called it "one epic takedown," adding that the video was "brutally funny."
In an interview last month with STAT News, Gates talked about meeting with Trump in March and bringing up the need for a White House science adviser. The president responded by offering Gates the job, he said.
Gates said he wasn't sure if Trump was serious or if he was just "being friendly," but he turned down the offer.
"That's not a good use of my time," Gates remembered telling Trump.
(Except for the headline, this story has not been edited by NDTV staff and is published from a syndicated feed.)