The day after Munjal Shah sold his company to Google in 2010, he was running when he experienced sharp chest pains. He ended up in the emergency room.

He was 37 at the time, but hadn't quite kicked an indulgence in sugary treats, like Frosted Flakes, Pop Tarts and cinnamon rolls. "Honestly, what went through my head is that it seemed so unfair," Shah recalled. "I had the best day of my entrepreneurial life after 10 years of work, and then I was going to die."

Shah was worried about a heart attack, given his family history — his father, who moved from India to the U.S. — had his first heart attack in his 40s.

But Munjal Shah's problem turned out to be an inflammation of the lining of his lungs. Nonetheless, that hospital visit changed the course of his life.

Figuring out who's serious about health

While at Google, he started taking classes at Stanford to learn about health and medicine. He cleaned up his diet and lost 40 pounds. And he made new friends, all fellow entrepreneurial types, who had similar health scares and subsequently changed their lifestyles.

The group eventually decided to quit their day jobs and start a health company. They had no clear business model in mind but were all curious about finding ways to reward people who were committed to being healthy.

First, they had to find them. And that's a lot more challenging than you might think.

Many of us fib to our doctors, saying that we eat better, drink less alcohol and exercise more than we actually do.

To get around these common lies, the team launched a health quiz, called Health IQ. It features questions that assess how health-conscious a person is, rather than how healthy they claim to be. For instance, instead of asking how much you run, they might ask if you can run an eight-minute mile. Rather than asking if you eat too much, the test will figure out if you understand portion control by checking if you can estimate how many cups of rice there are in a photo.

The test did a pretty good job of picking out those who were committed to their health. And it went viral. In less than four years, more than 1 million people took it.

During that time, about 2,000 of those people died.

And that's when Shah figured out how to make money: life insurance.

After factoring in things like gender, age and education status, Shah and his team learned that the health-conscious elite — the yoga practitioners, the crossfitters, the vegans or vegetarians, the strength trainers, the cyclists, the controlled diabetics, the triathletes and the marathoners — were far less likely to be among the people who died in this test group. Forty-one percent less likely, in fact.

In particular, it became clear that these people were less likely to die from cancer, which Shah calls the "blind spot" in most life insurance underwriting. Studies have shown that those who eat little meat, for instance, have a lower risk of colorectal cancer than people who eat meat most days of the week.

Shah still doesn't know from his data why the mortality rates are lower for yogi-loving vegans, at least not yet. It might be that they exercise more, eat better, are diligent about removing toxic chemicals from the home, or maybe it's a combination of factors. But for his purposes, it doesn't really matter. Now that he knows how to find them, he can sell them cheaper life insurance. And he estimates there are a lot of them — about 50 million in the United States.

How Health IQ works

Shah's company, Health IQ, isn't a carrier like some of the big life insurers you might recognize. Instead, it's a type of broker called an MGA that can offer special rates. Health IQ has deals with 3 carriers — SBLI, Ameritas and Assurity — to get health-conscious people who can pass the test a 4% discount. Those who meet a performance threshold, like running an eight-minute mile, get another 4 percent off.

Health IQ

The Health IQ team.

There's always a risk that people will game the system by cheating or lying, but Shah thinks it won't happen often. Getting a healthy friend to fill out the test, for instance, is akin to insurance fraud. And it's reason enough for companies to deny a claim.

It's also possible that daily yoga and kale juice will no longer appeal to a person who gets laid off, depressed or has a child. But Shah is betting this won't happen often, as the health-conscious tend to be committed for life. If it does, he stressed that he won't back out of the cheaper rate. "A contract is a contract," he said.

Health IQ does not take into account things like family history, as Shah thinks everyone should get a fresh slate (his own father, for instance, never got super healthy). He also said that Health IQ will look at traditional metrics like body mass index, but it will offer more leniency for bodybuilders with large muscle mass. One of his favorite anecdotes is that Arnold Schwarzenegger, at the height of his rippling abs phase, would have been considered obese by BMI alone.

In 22 months, the company has helped its customers enforce $5.3 billion in insurance coverage.

Silicon Valley's investors seem to like the idea of rewarding healthy people, which is not surprising given that it's a lot easier than trying to change the behavior of those who are struggling or lack the will. Countless studies have shown that technologies that nudge or coach users into getting healthy rarely work, at least not in the long term.

But some health experts are concerned that life insurance companies will start getting more detailed about evaluating health, but with fewer protections for policyholders. Life insurers, for instance, can discriminate on the basis of a person's genetic test results while health insurers are barred from doing so.

All of this could lead to privacy issues and penalties for those who can't afford things like gym memberships and Whole Foods. "Historically I think there has been a bright line between the two, and we may see that line start to blur," said Dr. Dan Gebremedhin, a physician and investor with Flare Capital Partners.

Health IQ has raised more than $81 million in funding. This week, it announced a fresh $34.6 million round led by Andreessen Horowitz, with participation from Charles River Ventures, Ribbit Capital, Foundation Capital, First Round Capital, Felicis Ventures and Western Technology Investments.