Researchers are looking for new ways to treat children with different types of melanoma (skin cancer), solid tumors, and lymphomas (blood cancers) that are any of these: * Advanced, which means cancer spread in the body or cannot be removed with surgery * Relapsed, which means cancer has come back after it had responded to previous treatment (responded means it stopped growing, gets smaller, or disappeared) * Refractory, which means cancer did not respond to previous treatment Pembrolizumab is an immunotherapy, which is a treatment that helps the immune system fight cancer. Researchers want to learn if different doses of pembrolizumab can cause at least 1 of the types of cancer to get smaller or go away. With Amendment 8, enrolment of participants with solid tumours and participants 6 months to under 12 years old with melanoma were closed. Enrolment of participants 12-18 years old with melanoma continues. Enrolment of participants who have tumours with specific traits (microsatellite-instability-high (MSI-H), and tumour-mutational burden-high ≥10 mutation/Mb (TMB-H)) also continues.