"How do you determine good ways of sorting 1 million 32-bit integers in two megabytes of RAM?" wondered Google chief executive Eric Schmidt. More than 1,000 geeks in the audience roared. A stumped McCain laughed with them.
It was a quirky start to what is becoming a fixture on the presidential campaign - a grilling by the fresh-faced Googlers who are trying to revolutionize the Internet.
In addition to free buffets and an outdoor volleyball court, Google employees now are getting a political perk: a chance to personally question presidential candidates. Company executives, meanwhile, get precious face time to press cherished issues with the politicians who want the White House.
The Google Interview could become the 21st-century equivalent of the candidate's pilgrimage to the General Motors plant. Sen. Hillary Rodham Clinton was first, in February, followed by McCain on Friday. The company has extended invitations to all the major candidates and expects more campaign appearances in coming weeks.
"I like to think of (seeking) the presidency as a job interview with the American people," Schmidt, who moderates the sessions, told McCain. "And you're also sort of interviewing with Google. It's hard to get a job at Google." The company famously demands college transcripts and high grades; Schmidt's staff whooped at the indirect praise.
"I know I have my work cut out for me," McCain replied.
After apologizing for his mind-bending opening inquiry, Schmidt, a regular Democratic political donor, heaped praise on his GOP interviewee. He asked a series of gentle questions about McCain's Vietnam War combat and POW experiences, a chapter virtually no one in his audience was old enough to recall.
The Googlers listened respectfully, but wanted to talk about the Iraq war, a subject that is weighing down McCain's campaign. McCain has remained steadfastly loyal to President Bush's war policy, including a recent increase in U.S. combat troops and a rejection of timetables for withdrawal.
The candidate delivered a well-worn but impassioned defense of the policy, guaranteeing that "if we have to withdraw on a date-certain, there will be chaos, genocide and other nations in the region will be drawn in."
Schmidt did not challenge this view, but one of his subordinates did.
Why discount the possibility that no one will win the war, the worker asked.
"Any rational observer would say that if the war's lost, then someone won the war," McCain responded. "Al-Qaida will win that war."
Over an hour and two minutes, the questions from the audience were sometimes offbeat, sometimes pointed. One questioner expressed surprise that a Republican would venture into this liberal area 35 miles south of San Francisco; a second said he had campaigned in 2000 for McCain.
Someone else offered him a choice of topics he would like to be questioned on: genocide, campaign finance reform or "the flag." McCain chose the Darfur genocide in Sudan, allowing that the federal government has not done enough, but stopping short of pledging U.S. troops to end it.
One Google worker asked whether McCain could recall his college GPA. The senator did not offer a number, but reminded his listeners that he graduated fifth from the bottom of his class at the U.S. Naval Academy.