Shares of EPAM (EPAM -0.71%), a leading IT consulting company, plummeted over 50% in a matter of two weeks after the beginning of Russia's conflict with Ukraine in February. Ukraine, Belarus, and Russia collectively were home to about 60% of EPAM's software designers and engineers, and with the war, EPAM's business was facing a serious threat.

But, as they say, adversity reveals true character. It's true for people and it's true for businesses. EPAM's second-quarter 2022 results, announced a couple of weeks ago, show that the company has navigated this highly complex situation brilliantly. Investors want to trust businesses that can stand the test of time, and EPAM has reinforced why it deserves their confidence.

EPAM reacted quickly, with focus on employees and customers 

EPAM provides IT consulting and software engineering services across the world. Its global workforce, operating from about 50 different countries, powers its wide-ranging services from strategy to development to operations for clients in a variety of different industries. 

A consultant presenting in an office meeting.

Image source: Getty Images.

As the war broke out, EPAM's first priority was ensuring the safety of its people in the region and the company took immediate steps to move its Ukraine employees to safer locations within the country or nearby countries. Many of its employees in Russia also moved. To ensure continuity for its clients, EPAM relocated a lot of work delivered by employees in the region to other parts of the world. The company also accelerated hiring in those regions to make up for lost productivity.

Of course, EPAM had to make substantial financial investments to execute all these actions, but I'm impressed. Shifting large and complex IT projects and realigning teams across the globe without causing massive disruptions is really hard. EPAM did that literally over a period of weeks. This shows the high caliber of talent at EPAM, the structure and processes the company has proactively put in place, and the ability to operate under intense pressure. 

It is impossible to predict when the war will end and, at least in the near term, EPAM will likely have to persist its efforts and investments to mitigate the risk of having employees in the region.  

Profits taking temporary backseat, but growth still impressive

Relocating employees  and the overall effort to ensure its clients are not impacted increased the company's expenses and lowered profitability materially in the first half of 2022. Operating income plunged from 14% of revenue in the first six months of 2021 to 9.4% of revenue for the same period of 2022. Net income dropped from 13.5% to 4.6% of revenue. EPAM believes that expenses may continue to stay higher for the rest of 2022 and even some part of 2023.

Despite the geopolitical headwinds -- compounded by businesses cutting their spending due to high inflation and rising interest rates -- customers continued to show their trust in EPAM as the company's year-over-year revenue growth for the first six months came in at 42.4%. The company also expects revenue to grow by a solid 22% in the third quarter of 2022 (lighter than the third quarter of 2021, when year-over-year revenue grew by 52%).

Since its founding in 1993, EPAM has solved complex problems for thousands of customers and has consistently delivered high-quality work for its clients. And even in these difficult circumstances the company is ensuring that it is putting its clients front and center.

The high P/E doesn't scare me away

EPAM offers deep expertise on a broad range of modern technologies, such as cloud computing, data analytics and AI, and virtual and augmented reality. EPAM's focus on continually expanding its technological capabilities through internal innovation as well as steady acquisitions has expanded its avenues of growth. 

EPAM co-founder Arkadiy Dobkin is still at the helm as the CEO. Under Dobkin's leadership, the company -- even accounting for the big pullback in its share price in the past 12 months -- has produced market-crushing returns for investors over the past five years (400%-plus vs. the S&P 500's 63%). And the returns are over 10 times that of the S&P 500 since the company went public about 10 years ago.

EPAM stock is trading at a price-to-earnings (P/E) valuation of about 67. Although that's below its all-time high value, the P/E may seem a bit on the higher side to some investors. But it has that P/E primarily because the market is willing to pay a premium for this business. Also, the current P/E is somewhat artificially inflated as the company's earnings are taking a major hit from its remediation expenses discussed above.

Investors want to put their hard-earned money in businesses that can not only succeed in favorable conditions, but also hold their ground when the odds are stacked against them. So, while a continuing war in the region remains a risk  and the macroeconomic conditions might continue to be challenging, EPAM has proven that it has every attribute needed to navigate these near-term headwinds and win in the long run. Now may be a good time for long-term investors to find a spot for EPAM in their portfolios.