At a time when the novel coronavirus outbreak has rattled the stock market, investors might be left wondering if it is a prudent idea to buy stocks right now. After all, it has been a crazy past month with the Dow Jones Industrial Average receding from a record-high close of 29,551 points on Feb. 12, 2020, to nearly 19,000 points on March 20.

But as my Foolish colleague Jason Hall points out, now may be a good time to buy stocks, even though the probability of the overall market going lower remains.

This, too, shall pass

According to Hall, the stock market is known to undergo corrections from time to time before rebounding strongly. It is never a good idea to time the bottom, as Hall points out, which is why investors should slowly start buying worthy stocks whenever there is a big double-digit drop in the broader market.

In fact, now seems like a good time for beginner investors to go long on certain tech stocks that may prove to be winners over the long run. NVIDIA (NVDA 6.18%) and Facebook (META 0.43%) could turn out to be such stocks.

Person pressing buy button on a keyboard.

Image source: Getty Images.

1. NVIDIA can shine despite the headwinds

NVIDIA is the leader in the discrete graphics processing unit (GPU) market, controlling nearly 69%, according to Jon Peddie Research. The company's gaming business supplied 48% of its total revenue last quarter. Revenue from this segment shot up 56% annually during the quarter as sales of its graphics cards increased.

NVIDIA might sustain that momentum in the coming quarters. The company's graphics cards are used by gamers to build PCs that will come in handy as an alternative means of leisure and entertainment at a time when going out to public places increases the risk of contracting the virus. Governments across the world have been advising the closure of theaters  and limiting restaurants to delivery or takeout only.

These moves to enforce social distancing are turning out to be a tailwind for the gaming industry. A South Korean website reports that sales of video game consoles are getting a boost. So it would be logical to assume that the PC gaming industry is also getting a boost, as it reportedly accounted for 24% of the global gaming market last year, according to Newzoo's estimates.

This could give NVIDIA's gaming business a shot in the arm in the near term by boosting GPU demand. Of course, NVIDIA did point out during its last earnings conference call in mid-February that its current quarter's revenue could take a hit of $100 million on account of the COVID-19 outbreak. That could be a result of potential supply chain disruptions, and also because NVIDIA wanted to account for the fact that it relies on China for about 30% of total revenue.

Despite the COVID-19-related hit, NVIDIA is still on track to clock 35% annual revenue growth this quarter. That's impressive, and the good part is that businesses in China seem to be getting back on their feet once again. As such, demand for NVIDIA graphics cards could remain strong despite the disruptions.

More importantly, NVIDIA is a long-term play on the data center market that's getting a boost thanks to the deployment of artificial intelligence (AI) solutions in the cloud. That market is growing rapidly, and so is the company's data center business, which clocked 42% annual growth last quarter. Considering these tailwinds, it might be a good time to start considering NVIDIA stock, as it trades at a much cheaper 45 times last year's earnings now as compared to where it was at the beginning of the year.

Any further pullbacks could make the stock cheaper and bring it closer to its five-year average price-to-earnings (P/E) ratio of 39, which would make it an attractive bet considering the pace of its growth.

2. Facebook's near-term pains make it a bargain

Social media giant Facebook has been a winner ever since it went public. Strong top- and bottom-line growth at the company over the years has led to solid stock price growth, but there has been a major pullback in 2020.

FB Chart

FB data by YCharts.

Facebook stock is down close to 20% this year. This isn't surprising, as the COVID-19 outbreak is expected to have serious consequences on the company's top line. Facebook gets nearly all of its revenue through advertising, and a large portion of that is under threat. Needham analyst Laura Martin estimates that between 30% and 45% of the company's revenue depends on those advertising categories that are at risk from the novel coronavirus outbreak.

Weak consumer demand in light of social distancing and lockdowns in various cities across the globe is hurting the entertainment, retail, travel, and packaged goods industries. Channel checks conducted by Needham reveal a drop in spending in these industries, which is why Facebook's revenue may take a hit.

For instance, the cancellation or postponement of major sports events this year could knock the wind out of Facebook's sails, and this would be one of the many challenges the company is facing. But the good news for investors is that the headwinds have made Facebook stock a bargain.

The stock's trailing P/E ratio of 23 is much lower than the five-year average multiple of nearly 49. The forward P/E ratio of 16 further indicates that Facebook stock is an attractive bet at current levels. Analyst estimates compiled by Yahoo! Finance predict approximately 20% revenue growth at Facebook in 2020 and 2021, along with impressive earnings growth.

Of course, the short-term headwinds are likely to weigh on the company's financial performance. But that shouldn't discourage you from going long, as Facebook could regain its mojo once the advertising dollars are back. After all, Facebook is the biggest social media platform in the world, with a market share of over 62%. Twitter -- its closest U.S.-based competitor -- has a market share of just over 14%.

Social media advertisement spending is expected to clock double-digit growth over the next couple of years. There is a chance that advertisers might hold back their spending on account of the novel coronavirus outbreak this year, but that setback should be temporary. But once ad spending returns to normal, Facebook might make the current downturn look like a nice buying opportunity given its social media dominance.