The NRMP utilizes a matching algorithm that considers the preferences of both the applicants and the residency programs. Medical graduates submit a ranked list of their preferred residency programs, while the programs submit a ranked list of applicants they are interested in. The algorithm then matches applicants to programs in a way that optimizes the preferences of both parties.