Wasn't something like this the premise for a character in Stargate Universe? The math wizz kid gets recruited because he solves a puzzle in a game they thought was impossible.
That was likely an homage to the 1984 film The Last Starfighter -- a teenager gets recruited "by an alien defense force to fight in an interstellar war" via being the top scorer on an arcade game.