SHANGHAI — Here’s one way to compete with Starbucks in coffee: Pay your customers.

Luckin Coffee, an unprofitable start-up offering big giveaways and aggressive subsidies, burst less than two years ago into a Chinese coffee scene long dominated by Starbucks. Helped by a smartphone app that lets users order coffee for delivery with a few finger taps, it has gained nearly 17 million customers and built 2,370 stores.

On Friday, stock investors in the United States had a chance to buy into this fast-growth, cash-burning model. Luckin’s shares were up 20 percent at the end of their trading debut in New York, after an initial public offering that valued the company at about $4 billion.

Luckin offers proof that China’s weakened tech start-up scene still has some of its old pop.

In recent years, new Chinese companies have risen to prominence, raising and burning money at a pace that would make Silicon Valley blush. Bike-sharing start-ups popped up overnight, flooding cities with tens of millions of rainbow-colored dockless bikes. A boom in online food and retail delivery has left the streets of Beijing and Shanghai cluttered with delivery men in bumblebee-yellow or blue helmets and suits, the colors of the two most dominant delivery companies.

Many of those companies have since scaled back, and some have flamed out, as China’s economy slows and financing for tech firms begins to dry up.