Sanjay Singh is one of the founders of hCentive, which built the software behind many of the Obamacare small-business insurance Web sites around the country. (Jeffrey MacMillan/Capital Business )

In the spring of 2009, Sanjay Singh, a self-described “technology guy with a passion for public policy,” started following the news around a health care bill being debated in the Senate Finance Committee. At the time, it was anything but certain whether the ambitious measure, initially proposed by President Obama, would become law.

Intrigued, Singh, the founder of what had over the past decade grown into a multinational software company, downloaded a copy of the bill online and started reading.

“It occurred to me that if the bill became law, it would require a technology solution to enable these new online health insurance exchanges,” said Singh, who at the time was running McLean, Va.-based GlobalLogic, a software product development firm. “I realized there was a possible business opportunity there.”

Singh didn’t wait for the legislation to pass. He and his two co-founders, Manoj Agarwala and Tarun Upadhyay, soon left GlobalLogic to found a new company, which they called hCentive. The plan was to start building the type of software the government would need to comply with the legislation, which called on state and federal officials to build online health insurance portals for individuals and small businesses. Once the bill passed — if ever passed — Singh and his team would be there waiting to capitalize.

It was a risky gamble, but one that paid off handsomely after the president signed the Affordable Care Act into law nine months later.

“That was definitely a moment of relief,” Singh recalls.

Singh’s company has since built state-run exchanges in four states, and this past year, hCentive contracted with the Department of Health and Human Services to construct the online, federally facilitated small-business marketplace used by employers in 33 states. In the process, what began as a team of three has now ballooned into a 700-employee company with annual revenue exceeding $50 million.

Singh credits much of that success to the extra time his team had to build the exchanges before they were slated to launch in 2013.

“We had a head start,” said Singh. “When we began working on this in the summer of 2009, I don’t think anybody else was really thinking yet about building the exchanges.”

Some of the company’s competitors “woke up” after the law was passed, he added, while others waited to start building the health exchange software until after the Supreme Court ruled that the law was constitutional in 2012. At that point, hCentive was already polishing its new products and had entered into talks with several of the states that elected to build their own insurance marketplaces, rather than default to a federally-operated exchange.

In 2012, the company was contracted by Colorado, Kentucky and New York to build those three states’ new health exchanges, each of which launched on schedule the following year. And while many state-run marketplaces ran into debilitating technical problems during the first year, the sites in those three states have run relatively smoothly.

“Our background building hundreds of different software products at our previous company was a big plus, and we had a great team,” Singh explained when asked how his company avoided problems encountered on other parts of the Healthcare.gov network.

He also gave credit to state health officials in Colorado, Kentucky and New York, where he says policymakers put a single decision-maker in charge of overseeing the projects.

“They each had a good system for engaging with vendors, and they each had one person who was authorized to make quick decisions, so we didn’t have to go through multiple state agencies,” Singh said. “I don’t think that was the case with some of the exchanges that ran into problems.”

One of those that ran into trouble was the federal government’s small-business marketplace, meant for employers in the states that didn’t build their own exchanges. After a string of delays, the Obama administration announced that it would postpone building the small-business portal, pushing the site launch back to the fall of 2014.

When it came time last spring for federal officials to select a software vendor to build the small-business site, it was hCentive’s early success in those first three states that helped it win the contract, Singh said. The company was also brought in to rebuild from scratch the marketplace in Massachusetts — the first such system in the country, which ran into major technical problems when officials tried to update it to comply with rules in the health law.

Health officials in both cases switched to hCentive after previously contracting with Fairfax, Va.-based CGI, to build the exchanges. The Obama administration repeatedly blamed CGI for Healthcare.gov’s defects following the rocky rollout in 2013 and has since ended its contracts with the company.

After the switch to hCentive, the federal small-business marketplace and the new Massachusetts health site both opened on schedule and largely without a hitch in November. On the latter site, enrollment is pacing well above last year, with 55,260 Massachusetts residents signing up for 2015 coverage by the end of December.

Health officials in Washington have not yet released enrollment figures for the federal small-business exchange, but they say the major technical hiccups that plagued and eventually forced them to delay the rollout of the site last year are rare this time around.

Of course, the health care law isn’t out of the woods yet. The Supreme Court last year agreed to consider a new challenge to the law, which could eliminate tax credits created to help low-income individuals afford insurance. A ruling against the Obama administration would mean that only individuals in states that built their own health exchanges would be eligible for the tax breaks. The high court is scheduled to begin hearing the case in March.

If the challenge is successful, it would deal a blow to Obamacare — but not to hCentive.

Because states would have to build their own exchanges to access the credits, Singh believes such a ruling would prompt many of the 33 states currently defaulting to the federal government’s health insurance marketplace to instead build their own. His company has already prepared an out-of-the-box exchange software product that states, if thrown into that situation, could have up and running in less that three months.

Thus, Singh now says a court decision against the very law he built his company around could actually result in “a big boost to the business.”

Follow J.D. Harrison and On Small Business on Twitter.