Ferrari's seven-time F1 world champion Lewis Hamilton took his rivals by surprise at the Chinese Grand Prix, taking pole position for the F1 Shanghai Sprint race.