When investing in the best top-quality companies, having a long-term horizon is the way to go. Like Warren Buffett once said: "Time is the friend of the wonderful company, the enemy of the mediocre." With this idea in mind, companies such as Berkshire Hathaway (BRK.A 0.85%) (BRK.B 0.91%), Nike (NKE -0.09%), and Alphabet (GOOG -0.69%) (GOOGL -0.69%) are remarkably solid candidates to buy and hold for the long term, perhaps even forever.

Berkshire Hathaway is built to last

Berkshire Hathaway is a diversified collection of businesses carefully selected by Warren Buffett himself over the decades. Buffett can make investing mistakes like everyone else; however, his investing approach is based on picking businesses with unquestionable fundamental strength, and this makes Berkshire a particularly solid alternative for investors with a long-term horizon. 

The company does business in a wide variety of sectors, such as insurance and reinsurance, financial services, railroads, energy, utilities, manufacturing, services, and retail, among others. Diversification can be a powerful strategy to reduce risk, and the whole is stronger than the sum of the parts when it comes to a company like Berkshire.

Buffett is 85 years old; unlike Jennifer Aniston, he is not getting any younger. This means that succession risk is an important consideration for investors in Berkshire over the middle term, especially since Buffett is a truly irreplaceable investor and business leader. 

On the other hand, Buffett and his copilot Charlie Munger have been planning the succession for several years now, and Berkshire's different subsidiaries operate in a highly independent and decentralized way. Berkshire has a long-standing culture of sound business principles, so the company is strong enough to continue producing solid returns over the years and decades ahead. 

Nike is a world champion

Michael Jordan, Cristiano Ronaldo, and Roger Federer have many things in common. To begin with, they are among the most talented and successful athletes in human history, and they also have sponsorship contracts with Nike. The enormously expensive contracts that Nike has signed with many of the biggest stars in different sports disciplines around the world provide a tremendously valuable source of brand differentiation for the company, and this means superior pricing power and above-average profitability for investors.

Nike enjoys tremendous scale. The company is expected to generate nearly $32.5 billion in revenue in the current fiscal year, with more than 50% of its total sales coming from international markets. The company's products include footwear, apparel, and equipment over a wide variety of regions, channels, and sports categories, and this reduces the risk from any particular product or country.

The company also benefits from a strong negotiating position with retailers all over the world. It's relatively easy for customers to choose one retailer over another, so retailers need to have the right merchandise from a powerful brand like Nike in order to remain competitive.

Nike's financial performance doesn't leave much to be desired. Constant currency sales increased 14% last quarter, while future orders in constant currency jumped by 17%. The company retained almost 32% of revenue as operating margin, and earnings per share grew by a vigorous 22% year over year.

Alphabet owns the Internet

The company formerly known as Google changed its name and corporate structure last year. Alphabet is now a collection of businesses of which Google is the most important contributor in terms of sales and profits, while the "Other Bets" segment covers several different projects and businesses in all kinds of futuristic technologies. Among others, the Other Bets division includes operations in areas such as self-driving cars, home connectivity, disruptive healthcare technologies, and even outer-space exploration. 

Google is one of the most valuable brands in the world; the name is so popular that to many consumers, Google is a synonym for online search. Based on data from NetMarketShare, Google owns a leading market share of 71.35% in desktop search, and it has a tremendously dominant share of 90.68% in the, arguably more important, mobile-search market.

It's not just about the search business -- the company owns seven different properties with over 1 billion monthly users each: Google Search, Android, Google Maps, Chrome, YouTube, Google Play, and Gmail. When it comes to competitive strength in the online world, Alphabet comes second to none.

Alphabet's financial performance is truly impressive for a company that big. The business produced $23.3 billion in revenue last quarter, a healthy increase of 23% in constant currency terms. Operating margin was 26% of revenue, while adjusted operating margin, which excludes stock-based compensation and other non-cash expenses, amounted to a staggering 34%.

The tech sector is particularly dynamic, but Alphabet is no average tech company. On the back of rock-solid competitive strengths and abundant financial resources, Alphabet looks remarkably well positioned to continue delivering sustained growth for investors over the long term.