'Deja Vu' leaked online a day before its official release. Bell referred to the session as a high-pressure situation that 'kept on toes' while he engineered and recorded the track. Bieber immediately took to the beat and ended up freestyling what would become 'Deja Vu' in the booth, with him and Malone going back and forth with ideas. Bell and Malone were halfway through the latter's debut album, Stoney (2016), when they played him a track that producer Frank Dukes had done.
In an interview with Billboard, Malone's collaborator Louis Bell recalled that Bieber visited Malone in the studio in January 2016. Before collaborating on a song together, Post Malone opened for Justin Bieber on the Purpose World Tour, and the two developed a friendship.