With the global economy reeling, it might feel unnerving to buy stocks right now. But thanks to a steep sell-off in the overall market, there are good buying opportunities for investors willing to go against the grain. As famed investor Warren Buffett has said, "We simply attempt to be fearful when others are greedy and to be greedy only when others are fearful."

Highlighting just how drastically the market has pulled back recently, the S&P 500 is down about 18% since Feb. 19. Furthermore, this sharp drop has more than erased all of the market's gains over the past 12 months. Of course, some stocks may have deserved their recent beating. Many growth stocks, for instance, may have been overpriced and were subsequently due for a correction. Other businesses may have simply been too dependent on a healthy economy. An investor's job in a market like this, therefore, is to find the stocks that have been oversold. Investors should be on the lookout bargains.

So, what are some oversold stocks to buy in this market crash? Here are two stocks that look like bargains today: The Cheesecake Factory (CAKE -5.53%) and Rubicon Project (MGNI -2.00%).

A person hitting a buy button on a keyboard

Image source: Getty Images.

The Cheesecake Factory

It's likely difficult for many investors to consider restaurant stocks during this downturn. Restaurants have been one of the hardest-hit industries as operators close their doors to help curb the spread of the coronavirus. For most restaurants, therefore, their only revenue source during this pandemic is curbside pickup and delivery -- revenue that is unlikely to come close to offsetting losses in dine-in sales.

Cheesecake Factory, an operator of high-end dining restaurants, has been no exception to the pain inflicted on restaurants across the country. The company has stopped accepting dine-in customers, shifting all sales to takeout orders and delivery. Further, Cheesecake Factory has furloughed 41,000 hourly workers and has even opted not to pay its April rent given landlord decisions to close properties and the company's efforts to prudently manage its financial position. 

"We are in various stages of discussions with our landlords regarding ongoing rent obligations," the company said in a March 27 SEC filing, "including the potential deferral, abatement and/or restructuring of rent otherwise payable during the period of the COVID-19 related closure."

But shares of Cheesecake Factory have been absolutely crushed during this downturn, falling 51% since mid-February. This gives the company a price-to-earnings ratio of just seven -- lower than the restaurant's lows of the 2008-2009 Great Recession. While it will likely take time after the economy reopens for Cheesecake Factory to return to 2019's dine-in customer counts, it's worth noting that the company brought in $127 million of net income last year yet its market capitalization after getting slammed is just $908 million today. That's a steal if Cheesecake Factory can return to health.

Management is confident it can weather this storm. "With 42 years of history as a guide, we believe we will overcome these challenging near-term operating conditions and be even better positioned for the long term," said Cheesecake Factory CEO David Overton in a March 23 business update. 

Rubicon Project

Another industry that has seen many stocks get pummeled is digital advertising. Investors are worried about the extent that marketers will reign in their ad spend with economic activity coming to a screeching halt recently. Rubicon Project, however, not only looks likely to withstand these market challenges but also to come out of the other side with even greater market share as advertisers shift spend and publishers move inventory to programmatic advertising (automated data-driven advertising).

As many marketers are forced to work with smaller budgets during this pandemic, they will likely turn to programmatic advertising to make their ad spend go further. Similarly, publishers with digital ad inventory may increasingly lean on programmatic capabilities to maximize yield on their ad spots. Rubicon Project is well-positioned if these trends play out. The company operates on the sell-side of the programmatic advertising market, helping publishers -- from websites to streaming services like Walt Disney's Hulu -- intelligently place digital ad spots in biddable market places for ad-buyers to insert their content. In addition, Rubicon operates a programmatic advertising exchange to make these automated transactions happen.

Programmatic advertising gives both marketers and publishers more flexibility, comparability, and measurability than many traditional digital advertising solutions, making it a great medium when advertisers need to ensure every dollar of ad spend is optimized. Indeed, the CEO of The Trade Desk (TTD 1.71%), the largest platform on the buy-side (the side that helps ad-buyers maximize their ad spend) of programmatic advertising, said last week that he's seeing marketers lean into programmatic advertising even more during this time. They are turning to data-driven advertising to be more efficient, he explained.

Sure, investors should still expect Rubicon Project's growth to slow as marketers operate on much smaller budgets. But this pandemic could help accelerate a shift to programmatic advertising as marketers aim to be as efficient as possible. This means Rubicon could gain market share during this time as more publishers look to make their inventory available in an efficient and agile marketplace.

On the heels of a recent merger that made Rubicon Project the largest independent sell-side platform, the company not only boasts a competitive advantage as a scaled ad-tech company with a powerful streaming TV ad business but it also notably ended 2019 with $143 million in cash (and no debt) when you add its cash to Telaria's -- the company Rubicon merged with. Yet shares of the tech company are down 55% since mid-February, putting the stock in oversold territory.

Keep in mind the risks

No investment, of course, is without risks. These are very uncertain times. Indeed, it's unclear when restaurants and other retailers will be able to open their doors again. More specifically, it's difficult to estimate how badly either Cheesecake Factory or Rubicon Project will be negatively impacted during the current quarter.

Even more, there's no guarantee that this is the bottom for these stocks; investors should expect significant volatility in the weeks and months to come. But the market is forward-looking and likely has done its best to price in the challenges ahead for both of these companies. Of course, the market can often overreact during downturns, leaving some stocks oversold. In this case, these two companies appear to be oversold -- at least for investors willing to buy these stocks today and hold for the long haul.