Mountain View's Coursera agreed to buy rival edtech Udemy. Both Bay Area companies went public in 2021 and have seen their stocks drop sharply.