The two-part cut was produced by G. Ry, whose other PartyNextDoor collaborations include "SLS" and "Let's Get Married." He told Genius
"The foundation of 'Problems' was started in a normal busy and hectic studio session with PND and crew at Noah '40' Shebib's State of the Art Studio, also known as "SOTA" Studios located in Toronto. I found the keyboard sound that would design the chords. I was working in headphones which is pretty rare because I don't usually wear them to work because I need feeling to get my juices going, but like I said it was a busy night so I was just trying to focus on something new to come up with. I ended up saving the session on my laptop because I wanted to sit down with it later. Then once I got back home in LA I re opened the session one morning, created a completely new set of chords and got to work…very loudly. Took me the whole day, I sent it off and immediately I got a text back from him saying, 'Yeah it's on the album.' I didn't hear the song until we were at Rihanna's house weeks later.
'Selfless' came about once after I heard 'Problems'. He just wanted me to take it to another direction while still leaving "Problems" exactly the way it is. It was bit of a task for me because we were doing so much moving around at the time and I was restricted to working in headphones at one point. Everyone even left to do a show across the country at one point while I stayed back so I had the freedom to work on it in speakers but it didn't come out the way I wanted it to so I kept working on it. Finally one night I just zoned out and it came together. I was pretty exhausted mentally so once I finished it I played it for Jaywray to give me the confirmation I needed which he signed off on then sent it off and crashed to bed. I never ended up hearing 'Selfless' and actually forgot about that part until one night recently I was at home and he sent me it. I though I was just listening to a mixed version of 'Problems' until after the first part was done and just heard 'Can I ask you crazy girls a question?' I was blown away and had to remember that that was also my beat as well lol."