Justice Ginsburg, 83, said she would not leave her job “as long as I can do it full steam.” But she assessed what is at stake in the presidential election with the precision of an actuary, saying that Justices Anthony M. Kennedy and Stephen G. Breyer are no longer young.

“Kennedy is about to turn 80,” she said. “Breyer is going to turn 78.”

For the time being and under the circumstances, she said, the Supreme Court is doing what it can. She praised Chief Justice John G. Roberts Jr.

“He had a hard job,” Justice Ginsburg said. “I think he did it quite well.”

It was a credit to the eight-member court that it deadlocked only four times, she said, given the ideological divide between its liberal and conservative wings, both with four members.

One of the 4-4 ties, Friedrichs v. California Teachers Association, averted what would have been a severe blow to public unions had Justice Scalia participated. “This court couldn’t have done better than it did,” Justice Ginsburg said of the deadlock. When the case was argued in January, the majority seemed prepared to overrule a 1977 precedent that allowed public unions to charge nonmembers fees to pay for collective bargaining.

A second deadlock, in United States v. Texas, left in place a nationwide injunction blocking Mr. Obama’s plan to spare more than four million unauthorized immigrants from deportation and allow them to work. That was unfortunate, Justice Ginsburg said, but it could have been worse.

“Think what would have happened had Justice Scalia remained with us,” she said. Instead of a single sentence announcing the tie, she suggested, a five-justice majority would have issued a precedent-setting decision dealing a lasting setback to Mr. Obama and the immigrants he had tried to protect.

Justice Ginsburg noted that the case was in an early stage and could return to the Supreme Court. “By the time it gets back here, there will be nine justices,” she said.