When Marissa Mayer was offered the chief executive job at Yahoo in the summer of 2012, she had a script for returning the pioneering Internet company to the tiny club of Silicon Valley powerhouses.

To many in the tech industry, the very thought of Yahoo regaining prominence was a reach. Its revenue had been flat or declining for the previous five years. Google and Facebook had long taken the lead, and a new generation of tech start-ups was starting to elbow its way into the spotlight. Yahoo? It was an afterthought.

The turnaround plan created by Ms. Mayer, a celebrated, though recently sidelined, executive at Google, was simple: Stop the downward spiral and increase Yahoo’s revenue within two or three years. After that, Ms. Mayer said she believed she could achieve double-digit annual growth by five years.

If Ms. Mayer could pull it off, she would become a business legend. Or, as had happened to several excessively optimistic executives before her, Yahoo could become her Waterloo.