We Fools know that the best way to make money in the markets is to buy great businesses and hold them for the long term. The trick to making this investing strategy work is to only buy the highest quality companies that you can find.

So, what companies do we think are capable of standing up to the test of time? We asked a team of investors to weigh in, and they picked NVIDIA (NVDA -2.68%), Costco (COST -0.14%), and EPAM Sytems (EPAM -2.76%)

Stacks of bills piled up near an hourglass.

Image source: Getty Images.

The top chipmaker for next-gen technologies

Leo Sun (NVIDIA): Shares of chipmaker NVIDIA rallied nearly 1,000% over the past three years, but I believe the stock could still roar higher over the next few decades. Unlike its industry peer Intel, which dominates the older industries of PC and data center CPUs, NVIDIA is heavily invested in forward-thinking technologies.

Most of NVIDIA's revenue comes from discrete GPUs for gaming. Demand for these GPUs has been consistently rising, thanks to more graphically demanding PC games. It also sells GPUs for professional visualization purposes, and cryptocurrency miners use its GPUs in mining systems.

NVIDIA is currently posting the stronger sales growth in data center GPUs. A growing list of enterprise customers are buying its high-end Tesla GPUs for machine learning purposes. Rising demand for "smarter" cloud services will boost sales of NVIDIA's data center GPUs over the long term. NVIDIA's DGX supercomputers could also disrupt the data center market by packing the power of hundreds of servers into a single power-efficient box.

NVIDIA is also a market leader in the automotive chip market. Its ARM-based Tegra CPUs power infotainment, navigation, and autonomous systems in higher end cars. Despite recent setbacks in the driverless industry, sales of NVIDIA's auto chips should keep rising as more driverless cars hit the road.

NVIDIA is currently posting double-digit sales and earnings growth, and I expect that trend to continue as its investments in next-gen technologies pay off. Therefore, I think NVIDIA is a great stock to buy and hold for a few decades.

An unusually steady retailing business

Demitri Kalogeropoulos (Costco): The "hold" portion of the "buy and hold" equation is by far the hardest one to put into practice. We enter most investments with the long-term in focus but can be tempted into short-term thinking after a volatile quarter or a rough fiscal year.

Costco shareholders have it easier than most in this regard. The warehouse retailer consistently steals market share from peers, after all, and this past quarter was no exception. Sales jumped 6% in the core U.S. market, compared to increases of 3% for Walmart and 4% for Target.

Meanwhile, Costco gets most of its earnings from subscription fees rather than product sales, which makes its business far more stable than that of a traditional retailer. That operating approach was a big reason why net income has improved in each of the last five fiscal years despite a growth slowdown that saw comparable-store sales drop to 4% from 7% in 2015.

Costco should have a bright future over the next few decades as it expands its store base, especially in international markets, while building out its online infrastructure. And its dependable earnings profile should help convince shareholders to stick around while they wait for those market-beating returns to accumulate over time.

A low-risk tech bet

Brian Feroldi (EPAM Systems): I'm a big believer that tech megatrends like blockchain, artificial intelligence, and automation will transform the business world for years to come. However, it can be hard to pick the eventual winners and losers because the technologies that will change the world tomorrow are still largely in their infancy. That's why I think it is a smart idea for investors to bet on IT service companies instead of the companies driving the changes. If you agree then you should get to know EPAM Systems.

EPAM Systems is an international provider of software engineering and IT consulting services. The company employs a small army of tech and design experts from around the world that can be called upon on a moment's notice to tackle any big tech project that its clients can dream up. 

One reason that I'm such a big fan of EPAM is that its client base is very sticky. This means that once they give EPAM a try they tend to hire the company again and again for new projects. In fact, the company's top 20 clients have been buying from the company consistently for an average of eight years. What's more, the longer they stay, the more they tend to spend. That's a big reason why the company's top-line has grown at a 28% compound annual growth rate over the last five years.

Looking ahead, I'm convinced that companies everywhere will continue to give EPAM more and more business as technological advances persevere. That should help drive double-digit revenue and profit for years to come, making EPAM Systems an ideal stock for long-term investors to buy and hold.