Riding high under the leadership of Satya Nadella, Microsoft has surpassed Exxon Mobil to become the second-most valuable company in the world, placing it just behind Apple, which holds the top spot.

The companies swapped places last week when concerns about the falling price of oil brought Exxon's shares down -- the energy giant's market capitalization fell to $401.9 billion on Friday from $403.9 billion on Wednesday.

On the other hand, a surge in Microsoft's share price drove its total market value above $410 billion on Friday, something which is being seen as a direct result of Nadella's turnaround efforts, including job cuts, and refocusing the company on mobile and cloud computing. Investors have also been pleased with his efforts to undo the mistakes of Windows 8, released two years ago.

"Microsoft has made a strategic change," said Daniel Ives, a tech analyst at FBR Capital Markets, adding that Nadella, who took the reins as the company's CEO earlier this year, still faces challenges with a company that is heavily reliant on the PC market, which has been in a state of steady decline in the recent years. However, compared with other longtime tech giants, such as IBM, Hewlett-Packard, Oracle, and more, "Microsoft has done the best job of trying to skate where the puck is going," he said.

Meanwhile, Apple with a market capitalization of over $668 billion remains the world's most valuable public company.