There’s still another month of spring left, but it seems as though we’ve already heard the song of the summer: 20-year-old Nickelodeon vet Ariana Grande’s "Problem" – a sax-driven, 1990s-throwback-R&B jam featuring a guest rap by Iggy Azalea – has exploded online and on radio, selling 438,000 copies in its first week. It was the fourth-largest debut week for a woman, and the biggest-ever debut for someone under 21; the song has topped the iTunes chart in more than 50 countries. "What it’s done so far is just incredible in this day and age," says Tom Poleman, the president of National Programming Platforms for Clear Channel. “She could become one of pop music’s core artists.”

Grande was already a superstar before "Problem" – but mostly among junior-high students. The Florida native spent the past five years in the Nickelodeon trenches, putting in grueling days in her role as the dimwitted Cat Valentine on the megahit kiddie comedy Victorious, and then its new spin-off, Sam & Cat. The role transformed Grande into a tween idol, with 15 million Twitter followers, but she was much more interested in a music career. "I hate acting,” says Grande with a laugh – she grew up worshipping Whitney Houston and Mariah Carey, and has serious vocal range and power of her own. "It’s fun, but music has always been first and foremost with me."

Grande was raised in Boca Raton by her graphic designer father and CEO mother, who runs a company that provides communication equipment for the armed forces, and has been singing and acting since she was six. She was signed by Justin Bieber’s manager, Scooter Braun, in 2013, but her professional music career got off to a rocky start with 2011’s "Put Your Hearts Up," a bubblegum-pop song she can barely bring herself to talk about. "It was geared toward kids and felt so inauthentic and fake," she says. "That was the worst moment of my life. For the video, they gave me a bad spray tan and put me in a princess dress and had me frolic around the street. The whole thing was straight out of hell. I still have nightmares about it, and I made them hide it on my Vevo page."

Republic, Grande’s record label, gave her more freedom on her 2013 album, Yours Truly, an adult R&B collection that featured guest rhymes by Mac Miller and Big Sean. It produced a Top 10 hit ("The Way") and debuted at Number One. But the intense shooting schedule of Sam & Cat, which produced 40 episodes for its first season, made promoting the record extremely difficult, and the album didn’t stay on the charts for long.

It did, however, make a big enough splash to grab the attention of Max Martin. The 43-year-old Swede is the most successful producer-songwriter of the past 20 years, having sold an astonishing 135 million singles. Thirty-eight of his songs have moved more than a million units, and he’s worked with everyone from Britney Spears and Bon Jovi to Taylor Swift and Maroon 5.

Wendy Goldstein, Grande’s A&R rep at Republic, spent two years trying to get Martin involved; finally, when work was about to begin on Grande’s album, he said he was in. "He has a young daughter that’s a huge Ariana fan," says Goldstein. "He said, ‘I’ve never seen my daughter excited about someone that I’ve worked with, and that’s really saying something.’"

Martin, who quietly moved to Los Angeles from Stockholm a few years ago, has cultivated an A-team of mostly Swedish writers and producers. "He’s the master of his craft because he knows how to teach it,” says protégé Savan Kotecha, who has worked closely with Martin for the past seven years. For about three weeks earlier this year, Martin and Kotecha holed up in a Los Angeles studio cooking up a half-dozen songs, with Grande popping in to help write lyrics; Martin’s main deputy, Shellback, and Ilya Salmanzadeh, a 27-year-old songwriter who’s one of the newest members of the crew, came in to help on "Problem."

"Problem" began as an untitled track by Kotecha that he nicknamed "The Whisper Song," after a 2005 Ying Yang Twins hit. "I don’t remember where I came up with it," says Kotecha, who has written most of One Direction’s biggest hits. "Maybe in an airplane bathroom. On my phone I have an audio note where I whisper, ‘One less problem.’"

Grande, who leans toward high-octane belting, was confused at first by the muted chorus. "I was scared to approach it, because of the whispers," she says. "Their objective was to do the opposite of a traditional song structure. The idea was to have a really belt-y verse and then a completely minimalistic, whispering, basic chorus. At first, I just didn’t like being all belt-y right away."

The next step was injecting some hip-hop into the song. "Scooter was obsessed with bringing in the Ying Yang Twins," says Goldstein. "We had them try, but they just flopped it. They couldn’t get it together." Grande pushed to get Iggy Azalea on the track. "We figured it had to be a girl," says Kotecha. "And there’s so few big-name -female rappers in hip-hop. She came in without any drama, got behind the mic and just killed it."

Martin put the song over the top: "He came up with the horns and all those -melodic things in the pre-chorus," says Kotecha. "Part of his genius is knowing that little thing that takes a song from 80 percent to 100 percent."

"Problem" became the first single from Grande’s still-untitled second album, due later this year. After days of teasing the track on her Twitter and Instagram pages, it was released on iTunes at midnight on April 28th. It shot to Number One on the iTunes chart in 37 minutes, before it had a single spin on the radio.

Charlie Walk, the Executive Vice President of Republic Records, says he suspected the song would be a hit the first time he heard it. "It's the 30-second rule," he says ."You know the difference between good and great in 30 seconds. . . And in pop music now, there's a desperate need for proper vocalists that can sing a song the same way live it sounds on record. Kids can smell bullshit."

Grande has several other Max Martin songs slated for the new album, which the label hopes will solidify her as 2014’s breakout pop star. "I hear a half-dozen songs that are going to resonate in the marketplace," says Monte Lipman, CEO and founder of Republic Records. "We have a lot of wood to chop."

For Grande, the song was a life-changing moment; for Martin and his song factory, it’s just another in a long series of pop smashes. "He has this Swedish-ness in the back of his mind," says Kotecha. "He never got caught up in his own hype or being a hotshot producer. He just keeps doing the work."