Dhiraj Mukherjee, co-founder of Shazam, knows better than most that it’s not always helpful to be ahead of the curve.

“People even now say, ‘Oh, it’s a great idea.’ It was way ahead of its time,” he says. “In the end, that was not necessarily an advantage [for me]. Being ahead of the market has consequences as well.”

Shazam, a smartphone app that gives you the name and artist behind the music playing around you, was founded in 1999 by Mukherjee, Chris Barton, Philip Inghelbrecht and Avery Wang. They wrote the audio analysis software that allowed the programme to identify any song – but the service was very different back then.

When it launched in 2002, Shazam had 1m songs on its database and took 15 seconds to process a user’s request. Today, it can take as little as two seconds to comb through 30m songs, and can cope with remixes, background noise and cover-band versions.

In the late 90s, there were no smartphones, no apps, and iTunes hadn’t yet been invented. To use Shazam, people would call a number, put their phone up to the radio, then receive a text identifying the song. It was fiddly, but technology was taking its time catching up to Shazam’s vision of the future.

“We could see from research reports that you’d be able to access internet on your phone, but it didn’t yet exist,” Mukherjee says. “It took forever for those things to happen. We would say ‘Where are these phones?’ I’m not saying that we foresaw the iPhone, but it was a gamechanger. Shazam became a really obvious user experience [after the app came out].”

Like many businesses, Shazam was conceived by two friends kicking around lofty ideas. Barton, frustrated by the fact that he couldn’t ever recognise songs, decided that if they had partnerships with radio stations, advertising on air, they could identify the song and sell music to listeners. Mukherjee wasn’t sure about the business model, and it’s not one that they ended up trying, but took a chance anyway.

“We didn’t have the technology and we didn’t know how we were going to make money,” he says. “But, despite that, I decided to quit my job [at tech startup Viant] and go into business together. I figured we’d find a business model. I didn’t realise we’d find six different ones.”

The search for a profitable business model is one particularly pertinent to technology startups. Despite being valued at $1bn in 2015, it wasn’t until this year, 14 years after it launched, that Shazam crossed over into profitability, largely thanks to advertising revenues.

In its search for a profitable business model, the company flirted with reverse charge text messages (50% of which the mobile operators would keep), deals with ringtone companies and mobile handset manufacturers, and affiliate agreements with iTunes – which made Apple a lot of money, but were less beneficial for Shazam.

Much of the business’s operating revenue has come from external funding, starting with $1m from angel investors in 2000, and $8.5m from venture capitalists in 2001. But it was not an easy time for technology companies. “[We were] growing a business in a collapsing market,” Mukherjee says. “The internet bubble burst in 2000 [and] there were startups going bust everywhere.

“There were times when we literally had to check: are we insolvent or solvent? You can’t trade if you’re insolvent – that’s a crime. We would say, ‘OK, we’re solvent, keep working’.”

It was an exhausting startup journey that took its toll on the founders – by 2003, three of the four had left, and only Wang still works with the company today (“It’s his signature scientific breakthrough and the algorithm continues to evolve”, Mukherjee says). Mukherjee moved to Save the Children, then to Virgin Money where he now works as the head of innovation. He also regularly mentors entrepreneurs, speaks at business events, and has invested in ex-Shazam employees who have gone on to launch their own enterprises.

“[As an investor], I look for that entrepreneur DNA,” he says. “Will they trudge through deep snow, uphill, at 25,000 feet for the business or not? If they’re doing it just because it’s fun or they think it’s cool, it’s never going to work. Businesses can change direction; it’s people that can’t really pivot.”

Does he see himself founding another startup company? He laughs and shakes his head ruefully. “It’s extremely tiring. I used to work 16- to 18-hour days and I would honestly not have had the stamina over 15 or 16 years [to stay with Shazam]. I have a wife and three kids and they test my stamina in different ways.”

But his time as an entrepreneur has, he says, shaped his view of the world. “When you’ve been an entrepreneur, you seek opportunity in a situation, whereas if you’re not you see obstacles or risk or challenges. The rule of thumb is: don’t go bankrupt, live to fight one more day.”

He pauses for a moment and then adds: “I had to give a talk a few months ago and I entitled it, ‘Don’t try this at home: lessons learned from a recovered entrepreneur’. But I’m concerned I might not have fully recovered, and I might just be an entrepreneur after all.”

Sign up to become a member of the Guardian Small Business Network here for more advice, insight and best practice direct to your inbox.