The outlook for Indian online retailer Flipkart was decidedly gloomy when Kalyan Krishnamurthy became chief executive officer in January 2017. The startup’s valuation was dropping, fundraising was more difficult and Amazon .com Inc. was pledging $5 billion-plus to siphon away customers.So the 46-year-old former hedge-fund manager took some risks. He fired senior managers, set more-aggressive sales targets, boosted spending on promotions and promised to dominate India’s festival-season shopping.His strategy worked, and now comes the return on those risks –- a $16 billion initial investment from Walmart Inc. in Flipkart Group that helps cement the Indian company’s lead against Amazon and Alibaba Group Holding Ltd. in the world’s fastest-growing major economy. Online shopping in India is projected by Morgan Stanley to reach $200 billion within the next decade, compared with $30 billion now.“His relentless focus and his aggressive execution changed Flipkart’s fortunes,’’ said Anil Kumar, CEO of RedSeer Consulting in Bengaluru. “He brought the edge that Flipkart was missing.’’The deal announced Wednesday is the biggest-ever by a foreign buyer in India, and it represents a significant part of Walmart’s overseas expansion efforts. Since entering Mexico in 1991, the world’s largest retailer has closed money-losing operations in Germany and South Korea.Two years ago, Walmart sold its Chinese e-commerce business, Yihaodian, in return for a financial stake in JD.com Inc., the smaller rival to Alibaba. The number of Walmart’s international stores hasn’t budged from about 6,000 since 2013, and it’s had to shutter outlets in Japan and Brazil.Krishnamurthy will remain CEO of Flipkart, Walmart said. The company, founded in 2007 by Binny Bansal and Sachin Bansal, is the most valuable of 10 unicorns in India, according to CB Insights, and backers have included Tiger Global Management, SoftBank Vision Fund, Tencent Holdings Ltd., EBay Inc. and Microsoft Corp.Krishnamurthy declined to comment for this story.“For Flipkart, this deal is more than just money,’’ said Satish Meena, a New Delhi-based senior forecast analyst at Forrester Research Inc. “This deal with Walmart can provide Flipkart the expertise of running offline stores, access to sellers and manufacturers, supply chain and the know-how to get into the grocery segment.’’Krishnamurthy spent seven years in EBay’s Asia finance operations before joining Tiger Global as its finance director in 2011. He first arrived at Flipkart in early 2013 as its interim chief financial officer to support the Bansals, who each spent time as CEO. They are not related.Yet their company struggled to maintain relevance against the behemoth Amazon, which was shut out of China by Alibaba and JD and didn’t want a repeat in India. Amazon committed $5.5 billion to its efforts, and country manager Amit Agarwal adapted the site to local conditions – such as simplifying the app so it didn’t crash cheap smartphones.That helped propel Amazon to No. 2 behind Flipkart in just four years, and the Seattle-based company started to eye a partnership with Flipkart. Both Bansals stepped aside for Krishnamurthy in January 2017 –- a year that many observers said would be make-or-break for both him and the startup.Krishnamurthy started his tenure by trying to change the narrative from one of “deep-pocketed Amazon versus startup Flipkart’’ to one based on a homegrown operator knowing what 1.3 billion Indians want.He set goals for online traffic and sales, streamlined operations and fired poor performers. Krishnamurthy also implemented what he called the “80-20 rule’’ –- focusing on the 20 percent of categories that generated 80 percent of Flipkart’s revenues. Those included large appliances, fashion and mobile phones.“He would pound on the doors of vendors to cut exclusive deals,’’ said Kumar, who watched Krishnamurthy in action. “He would get on a flight to meet the company executives to seal the deal.’’India is a medley of income levels, languages and cultures –- a place Krishnamurthy describes as “several countries within a country.’’ Krishnamurthy said he wanted Flipkart to appeal to as wide a demographic as possible.The company introduced round-the-clock customer service, offered demonstrations to first-time appliance buyers and sent technicians to typically small homes to mount TVs on the wall. Krishnamurthy himself answered customer-service calls.“It is an eye-opener on how and why India buys online,’’ he told Bloomberg News during a 2017 interview at company headquarters in suburban Bengaluru. “It’s been a great investment of my time.’’Krishnamurthy, who earned MBAs from the Asian Institute of Management in the Philippines and from the University of Illinois at Urbana-Champaign, is a sharp dresser who doesn’t look out of place among the millennial hordes at a workplace adorned with posters of Albert Einstein, Coco Chanel and John Lennon.The CEO is an ardent yoga practitioner, constantly sips water and bounds up and down the stairs at work. He is the father of two young daughters.He also takes his online shopping seriously.“I’m a big customer of Flipkart,’’ he said. “In fact, we have two of everything at home, and that really annoys my wife.’’