Is Groupon engineering a comeback?

A little over a year ago, Groupon Inc. was facing a grim outlook over its long-term viability.

The company's profit was less than stellar. It faced growing competition from other companies offering deals on restaurants, retail stores and gyms. And its stock was plunging fast just months after it went public.

But on Wednesday, the Chicago-based company posted second-quarter earnings that beat expectations and announced the permanent appointment of Eric Lefkofsky as the company's chief executive. He had been serving as interim CEO since February when Andrew Mason was ousted.

Groupon said after the markets closed Wednesday that it lost $7.6 million in the April-June period. That's compares with a profit of about $28 million during the same period the year before. Revenues, meanwhile, rose 7% from a year earlier to $608.7 million.

Analysts had expected revenue of $606.1 million, according to Bloomberg.

On Thursday, Groupon shares rallied and were up were up nearly 42%, rising $2.06 to $10.76. Since August 2012, its shares have risen 25%.

Whether Groupon can keep that momentum going remains to be seen, but Lefkofsky said he was focused on long-term strategies that include offering multiple deals on its website and to mobile devices instead of one daily to users' email inboxes as the model long had been.

Earlier this year Groupon said it would expand its Groupon Reserve program, a restaurant-booking service. It initially started in 10 cities, including Los Angeles, New York and San Francisco. The company also has plans to become an e-commerce player, selling household products and vacations, among other items.

"We're trying to convey this basic message, which is, we want Groupon to be the place you start with when you want to buy anything, anywhere, any time," Lefkofsky told the Chicago Tribune [subscription required]. "We want you checking Groupon first. You might find a great deal on something you're going to buy anyway."