LONDON — For the last four years, Ariel Hsing, 16, has played table tennis at least three hours a day, six days a week. Her parents set up a special room for the game at the back of their house in San Jose, Calif. Out went the porch, the fountain and the flower beds. In went a well-lighted space for a table and a ball-return machine. Live-in coaches were flown in from China.

Her father, a computer software engineer, left his job with IBM so he could work from home, available to ferry his daughter to practices and matches. Hsing’s schoolwork was never compromised. The deal was that every report card had to be straight A’s or table tennis would be withheld. A 91 on a grammar test once put her oh so close to a B.

On Sunday night, all this effort nearly paid off with an incredible upset as Hsing — ranked No. 115 in the world — nearly beat the second seed in the Olympics, Li Xiaoxia of China. The score was 11-4, 9-11, 11-6, 6-11, 11-8, 11-9.

“This is such a huge confidence builder,” Hsing said excitedly. “When I just let go and play, I can compete with the world’s best.”