Hillary Clinton more than held her own during an appearance on actor and comedian Zach Galifianakis' spoof talk show Between Two Ferns, perfecting a deadpan comeback to his offensive questions.

The Democratic Presidential candidate followed in the footsteps of US President Barack Obama by making an appearance on the show, where Galifianakis plays the character of a hilariously rude talk show host who does his best to make his guests uncomfortable with his line of questioning.

The cut and thrust of politics and Clinton's legal training stood to her as she was well able for The Hangover star, who tried to open the interview by sneaking up on her wearing a Halloween mask, before being tackled by two Secret Service agents.

She deadpans: "Not a good idea around the Secret Service."

Galifianakis went down a blatantly sexist line of questioning, at one point asking Clinton: "As secretary how many words per minute could you type? And how does President Obama like his coffee?"

She replies: "You know Zach, those are really out of date questions. You need to get out more."

At one point she deadpans: "I really regret doing this."

Galifianakis took a jab at Clinton's dress sense, saying: "I'd love to meet the person who makes your pant suits. Because for Halloween I wanted to go as a librarian from outer space."

She replies, smiling: "I think that would be a good look on you."

Towards the end of the sketch, Galifianakis says he needs to break for a commercial sponsor and plays a pro-Trump ad.

"Why would you play a commercial for my opponent in the middle of our interview?" Clinton asks.

"He paid me in steaks," Galifianakis replies.

"I'd be afraid to eat them if I were you," she says.

To wrap up the interview, the comedian slips in a cheeky joke at the expense of Clinton's widely publicised email scandal, saying: "Well this has been a lot of fun, Mrs Clinton. We should stay in touch. What's the best way to reach you… email?"