Days before several Democratic presidential nominees debate in October, people in New York will have an opportunity to see two candidates interviewed in person.

Pete Buttigieg, the mayor of South Bend, Ind., and Julián Castro, a former mayor of San Antonio who served as the federal housing secretary under President Barack Obama, will appear at separate events at the 20th New Yorker Festival, which runs from Oct. 11 to Oct. 13 in various venues around Manhattan.

“We wanted to really seize on the moment,” David Remnick , the magazine’s editor, said in a phone interview on Tuesday.

The festival will also host another prominent Democrat: House Speaker Nancy Pelosi, who will be interviewed onstage by the journalist Jane Mayer. It will be a reunion of sorts: Mayer interviewed Pelosi at the festival in 2011.