Accused Wall Street scammer Bernie Madoff will appear in court this afternoon and answer questions for a judge in order to assess a potential conflict of interest between him and his lead attorney.

Madoff — currently out on $10 million bail and confined to house arrest in his posh Upper East Side penthouse pad — last appeared in Manhattan federal court on Jan. 14 for a bail hearing.

Prosecutors are asking Madoff to answer questions today over a potential conflict of interest concerning his lawyer Ira Sorkin, who once invested $900,000 with the disgraced financier.

“These facts create a potential conflict of interest because a situation may arise that could result in Mr. Sorkin having loyalties divided between his sons and Madoff,” the feds said in court papers. “For example, Mr. Sorkin could be less likely to challenge restitution that the Government will seek from Madoff, upon a conviction, because restitution could be in the interests of Mr. Sorkin’s sons.”

The hearing comes as Madoff is expected to waive indictment and plead guilty later this week to masterminding the alleged scam.

Madoff, 70, was busted on Dec. 11 for allegedly running a $50 million Ponzi scheme and charged with one count of securities fraud. Under the terms of his bail, the former Nasdaq stock market chairman — who the feds claim confessed to running a “giant Ponzi scheme” over decades — may only leave his apartment for court appearances.