Finding the right companies to invest in at the right time isn't always easy, and sometimes it pays to take a look at what others are doing to get some ideas. That doesn't mean you should follow the herd when it comes to picking stocks, but spotting companies that are gaining the attention of smart people on Wall Street can be a wise way to find stocks you might have overlooked.

To help you find some companies that look like smart bets, we asked three Motley Fool contributors for stocks that Wall Street's best and brightest are focusing on right now, and they came back with Visa (V 0.72%), Eagle Materials (EXP -0.10%), and Microsoft (MSFT 0.35%). Here's why.

Computer sitting on table with charts on it.

Image source: Getty Images.

Hedge funds simply love this stock

Neha Chamaria (Visa): In the fourth quarter of 2018, 25 hedge funds added Visa to their portfolios, and nearly 90 added more shares to their existing Visa holdings. Visa's clearly a loved stock among some of the smartest minds on Wall Street, which might even partly explain the stock's rally since mid-December: It's up almost 18% since!

Another quarter has lapsed since these hedge funds bought Visa shares, and they might've already been raking in the moola, so is there still time for you to buy the stock? I'd answer that with a resounding yes, provided you have a long-term investing horizon.

You see, Visa is not only among the best stocks in the financial sector, it's also a smart way to play hot trends like the Internet of Things. Visa's extensive global payments network should facilitate the rise of cashless and digital payments as well as e-commerce. As more merchants go online to sell products and services and more devices connect to the internet, consumers have a greater incentive to use credit, debit, and prepaid cards. That means an ever-growing addressable market for a company like Visa, whose cobranded cards are issued by financial institutions like banks. Visa in turn earns a fee every time one of its cards is swiped for a purchase. As of the first quarter, Visa had 3.3 billion cards in circulation.

For a company that has consistently grown revenues and earnings by double digits and generated operating margins north of 50% in recent years, it's easy to see why Visa shares trade at a premium valuation. However, the stock might still be a great buy at a price-to-earnings ratio of 34 times, given that it's expected to grow earnings at a strong pace in coming years. With the company also paying regular dividends and recently kicking off a fresh $8.5 billion share repurchase program, you shouldn't regret owning Visa.

An activist investor is moving in. Should you?

Maxx Chatsko (Eagle Materials): A five-year total return of 1.4% has placed Eagle Materials firmly in the crosshairs of activist investor Sachem Head Capital Management. An SEC filing shows that the hedge fund has built up an 8.9% equity stake in the producer of frack sand and building materials. The well-known activist investor is seeking radical changes, including the breakup of the business. 

While the infrastructure company's management has yet to confirm the course of talks with Sachem Head, it has replaced its CEO in recent months. The only other source of information for curious shareholders comes from a Bloomberg report. According to analysts briefed on the matter, the hedge fund wants Eagle Materials to sell or write off its Northern White Sand business, which is losing significant sums now that most oil and gas producers are looking to source proppants locally. Meanwhile, Sachem Head thinks the cement and wallboard businesses alone could fetch up to $130 per share, a significant premium to the current stock price of the entire company.

Should investors follow the hedge fund into a new position? Well, on the one hand, the business isn't struggling. It posted an earnings-before-income-taxes margin of 22.7% in the first nine months of fiscal 2019 (the year ending March 31). That's about the same as in recent years. On the other hand, activist investors rarely have the long-term interest of shareholders in mind. That means things could get messy, especially if management decides to reject the demands of Sachem Head.

With a new CEO at the helm, it appears that change is coming one way or another for Eagle Materials, but the stock isn't necessarily cheap, despite its poor performance in recent years. Therefore, it may be better to steer clear of the infrastructure stock until the dust settles or, at the very least, more details emerge about the road ahead.

A tech giant reborn

Chris Neiger (Microsoft): There's a reason 22 analysts currently have a "strong buy" rating for Microsoft: The company has become a powerhouse in the growing cloud computing market.

Microsoft has 16.5% of the public cloud computing market -- up from less than 14% at the end of 2017 -- with only Amazon taking more market share (32%), and far ahead of Alphabet's Google's 9.5%. Not only is that impressive for a company whose name used to be synonymous with its Windows software, but the company's cloud computing prowess is also helping to drive revenue and earnings up.

In its fiscal second quarter, Microsoft's sales increased 12% year over year to $32.5 billion, and earnings per share came in at $1.10, both beating analysts' consensus estimates. The tech giant's Intelligent Cloud sales popped by 20% in the quarter, and sales of Azure -- its key cloud computing product -- skyrocketed 76% from the year-ago quarter.

Not only is Microsoft benefiting from its cloud computing business now, it also has a lot more room to grow. The public cloud computing market was worth $175 billion last year but is expected to grow to $278 billion by 2021.

Microsoft will report its third-quarter results later this week, and management is expecting sales of between $29.4 billion and $30.1 billion, which would be an increase of about 11% at the midpoint. With Microsoft already seeing strong growth from its cloud computing business and the market continuing to grow, investors need to see this company the way many smart people on Wall Street do: as a wise long-term investment.