Since Marissa Mayer became chief executive of Yahoo, she has been working hard to get the Internet pioneer off its deathbed and make it an innovator once again.

She started with free food and new smartphones for every employee, borrowing from the playbook of Google, her employer until last year. Now, though, Yahoo has made a surprise move: abolishing its work-at-home policy and ordering everyone to work in the office.

A memo explaining the policy change, from the company’s human resources department, says face-to-face interaction among employees fosters a more collaborative culture — a hallmark of Google’s approach to its business.

In trying to get back on track, Yahoo is taking on one of the country’s biggest workplace issues: whether the ability to work from home, and other flexible arrangements, leads to greater productivity or inhibits innovation and collaboration. Across the country, companies like Aetna, Booz Allen Hamilton and Zappos.com are confronting these trade-offs as they compete to attract and retain the best employees.