a study to compare the administration of pembrolizumab after surgery versus administration both before and after surgery for high-risk melanoma

Conditions: Acral Lentiginous Melanoma; Clinical Stage III Cutaneous Melanoma AJCC v8; Clinical Stage IV Cutaneous Melanoma AJCC v8; Mucosal Melanoma

Summary: this phase ii trial studies how pembrolizumab works before and after surgery in treating patients with stage iii-iv high-risk melanoma. immunotherapy with monoclonal antibodies, such as pembrolizumab, may help the body's immune system attack the cancer, and may interfere with the ability of tumor cells to grow and spread. giving pembrolizumab before and after surgery may work better compared to after surgery alone in treating melanoma.

primary objective: i. to compare event-free survival (efs) in participants with high-risk resectable melanoma randomized to neoadjuvant pembrolizumab (mk-3475) with participants randomized to adjuvant pembrolizumab (mk-3475). secondary objectives: i. to assess the frequency and severity of toxicities on each of the arms. ii. to compare between arms overall survival (os), disease control at 24 weeks, locoregional control in the surgical site(s), and total number of pembrolizumab (mk-3475) doses received. iii. on the neoadjuvant arm, to estimate the pathologic response rate, the response evaluation criteria in solid tumors (recist) 1.1 response rate (confirmed and unconfirmed complete response \[cr\] and partial response \[pr\]), and the immune-related (i)recist response rate (confirmed and unconfirmed cr and pr), before surgical resection; to compare definitions of pathologic partial response; and to evaluate the association between pathologic response and efs and os. iv. to describe the proportion of participants on each arm who received the surgery planned at randomization. additional objective: i. to bank tumor tissue and whole blood in anticipation of future correlative studies in this participant population. outline: patients are randomized to 1 of 2 arms. arm i: within 17 days (preferably within 14 days) days after surgical resection, patients receive pembrolizumab intravenously (iv) over 30 minutes on day 1. treatment repeats every 3 weeks for 18 cycles in the absence of disease progression or unacceptable toxicity. patients also undergo collection of blood throughout the study, and magnetic resonance imaging (mri) or computers tomography (ct) on study. arm ii: patients receive pembrolizumab iv over 30 minutes on day 1 every 3 weeks for 3 cycles, then undergo surgical resection within 3 weeks. within 84 days, patients receive pembrolizumab iv over 30 minutes every 3 weeks for 15 cycles in the absence of disease progression or unacceptable toxicity. patients also undergo collection of blood throughout the study and mri or ct on study. after completion of study treatment, patients are followed up at 3 and 12 weeks, then every 3 months for 2 years, every 6 months for 3 years, then every 12 months for up to 10 years.

Eligibility criteria:
inclusion criteria: * step 1 registration (randomization): patients must have clinically detectable stage iii (clinically detectable n1b, n1c, n2b, n2c, n3b and n3c) or stage iv resectable melanoma. patients with melanoma of mucosal or acral origin are eligible. patients with melanoma of uveal origin are not eligible. patients with a history of brain metastases are not eligible. clinically detectable is defined as disease that is apparent and measurable via physical examination or radiographic imaging. * step 1 registration (randomization): patients are eligible for this trial either at initial presentation of their melanoma or at the time of the first detected nodal, satellite/in-transit, distant metastases, or recurrent disease in prior lymphadenectomy basin or distant site. nodal, satellite/in-transit metastasis, distant metastases or disease in a prior complete lymphadenectomy basin must have been confirmed histologically by hematoxylin (h) \& eosin (e) stained slides. * step 1 registration (randomization): patients with multiple regional nodal basin involvement are eligible. gross or microscopic extracapsular nodal extension is permitted. * step 1 registration (randomization): patients must have histologically proven stage iiib or higher. this would entail pathologic confirmation beyond the primary or initial diagnosis of melanoma involving fine needle aspiration cytology or biopsy confirmation of any n-category or m-category resectable site. * step 1 registration (randomization): patients must not have received previous neoadjuvant treatment for their melanoma. patients may have received prior non-immunotherapy adjuvant therapy. patients must not have had prior immunotherapy including, but not limited to ipilimumab, interferon alfa-2b, high dose interleukin (il)-2, pegylated-interferon (peg-ifn), anti-pd-1, anti-pd-l1 intra-tumoral, or vaccine therapies. patients must not be planning to receive any of the prohibited therapies during treatment phases on the study. * step 1 registration (randomization): patients must not be planning to receive concomitant other biologic therapy, hormonal therapy, other chemotherapy, surgery, while on protocol therapy. * step 1 registration (randomization): patients may have received prior radiation therapy, including after prior surgical resection. all adverse events associated with prior surgery and radiation therapy must have resolved to =\< grade 1 prior to randomization. * step 1 registration (randomization): patients must be \>= 18 years of age * step 1 registration (randomization): all patients must have disease status documented by a complete physical examination and imaging studies within 42 days prior to randomization. imaging studies must include a ct of the chest, abdomen and pelvis with intravenous contrast (unless contraindicated). for patients with melanoma arising from the head and neck, dedicated neck imaging (ct with intravenous contrast is required. if the patient has unknown primary with disease in the axilla, neck imaging is required ct imaging must be done with intravenous contrast if there are no contraindications for it. extremity melanomas must be imaged using ct with intravenous contrast or mri with and without gadolinium * note: pet-ct scans are not acceptable to establish eligibility. non-iodinated ct scans that are part of common pet-ct imaging protocols do not provide contrast for difficult to ascertain areas such as the neck and liver, and do not provide enough ct detail to perform appropriate recist 1.1 measurements. as such, a pet-ct with non-contrast ct or non-diagnostic quality ct images is considered insufficient for the detection of melanoma. * step 1 registration (randomization): all patients must have a ct or magnetic resonance imaging (mri) of the brain within 42 days prior to randomization. the brain ct or mri should be performed with intravenous contrast (unless contraindicated). * step 1 registration (randomization): absolute neutrophil count (anc) \>= 1,500/microliter (mcl) (within 42 days prior to randomization). * step 1 registration (randomization): platelets \>= 100,000/mcl (within 42 days prior to randomization). * step 1 registration (randomization): hemoglobin \>= 10 g/dl (within 42 days prior to randomization). * step 1 registration (randomization): total bilirubin =\< 1.5 x institutional upper limit of normal (iuln) (except patients with gilbert's syndrome, who must have a total bilirubin \< 3.0 mg/dl) (within 42 days prior to randomization). * step 1 registration (randomization): serum glutamic-oxaloacetic transaminase (sgot) (aspartate aminotransferase \[ast\]) and serum glutamate pyruvate transaminase (sgpt) (alanine aminotransferase \[alt\]) =\< 2 x iuln (within 42 days prior to randomization). * step 1 registration (randomization): alkaline phosphatase =\< 2 x iuln (within 42 days prior to randomization). * step 1 registration (randomization): patients must have lactate dehydrogenase (ldh) performed within 42 days prior to randomization. * step 1 registration (randomization): patients must have adequate renal function as evidenced by calculated creatinine clearance \> 30 ml/min. the creatinine level (mg/dl) used in the calculation must be obtained within 42 days prior to randomization. * step 1 registration (randomization): patients must have zubrod performance status =\< 2. * step 1 registration (randomization): patients must not have a history of (non-infectious) pneumonitis that required steroids or current pneumonitis. * step 1 registration (randomization): patients must not have an active infection requiring systemic therapy. * step 1 registration (randomization): patients must not have active autoimmune disease that has required systemic treatment in past 2 years (i.e., with use of disease modifying agents, corticosteroids or immunosuppressive drugs). replacement therapy (e.g., thyroxine, insulin, or physiologic corticosteroid replacement therapy for adrenal or pituitary insufficiency, etc.) is not considered a form of systemic treatment. * step 1 registration (randomization): patients must not have received live vaccines within 42 days prior to randomization. examples of live vaccines include, but are not limited to, the following: measles, mumps, rubella, chicken pox, shingles, yellow fever, rabies, bacillus calmette-guerin (bcg), and typhoid (oral) vaccine. seasonal influenza vaccines for injection are generally killed virus vaccines and are allowed; however, intranasal influenza vaccines (e.g., flu-mist) are live attenuated vaccines, and are not allowed. * note: the covid-19 vaccines (currently available and those in the pipeline for fda emergency use authorization or fda approval) do not contain live virus, and therefore, covid-19 vaccination does not affect or preclude eligibility for the s1801 trial. for patients who have undergone lymphadenectomy, vaccines should be delivered to a limb with an intact lymph node basin (sentinel lymph node biopsy in a limb is acceptable). the vaccine should not be administered in a limb that has undergone lymphadenectomy. * step 1 registration (randomization): patients known to be human immunodeficiency virus (hiv) positive are eligible if they meet the following criteria within 30 days prior to randomization: stable and adequate cd4 counts (\>= 350 mm\^3), and serum hiv viral load of \< 25,000 iu/ml. patients may be on or off anti-viral therapy so long as they meet the cd4 count criteria. * step 1 registration (randomization): patients must not have known active hepatitis b virus (hbv) or hepatitis c virus (hcv) infection prior to randomization. note: no testing for hepatitis b and hepatitis c is required unless mandated by local health authority. * step 1 registration (randomization): prior malignancy is allowed providing it does not require concurrent therapy. * step 1 registration (randomization): women of childbearing potential must have a negative urine or serum pregnancy test within 28 days prior to randomization. women/men of reproductive potential must have agreed to use an effective contraceptive method for the course of the study through 120 days after the last dose of study medication. should a woman become pregnant or suspect she is pregnant while she or her partner is participating in this study, she should inform her treating physician immediately. a woman is considered to be of "reproductive potential" if she has had menses at any time in the preceding 12 consecutive months. in addition to routine contraceptive methods, "effective contraception" also includes heterosexual celibacy and surgery intended to prevent pregnancy (or with a side-effect of pregnancy prevention) defined as a hysterectomy, bilateral oophorectomy, or bilateral tubal ligation. however, if at any point a previously celibate patient chooses to become heterosexually active during the time period for use of contraceptive measures outlined in the protocol, he/she is responsible for beginning contraceptive measures. patients must not be pregnant or nursing due to unknown teratogenic side effects. * step 1 registration (randomization): patients must be deemed medically fit to undergo surgery by the treating medical/surgical team. * step 1 registration (randomization): patients must be willing to submit the following surgical specimens: either all tissue blocks from the surgical specimen or two slides per block (\[1\] hematoxylin and eosin \[h\&e\] slide and \[1\] unstained slide or \[2\] unstained slides if h\&e stained slides cannot be provided). * step 1 registration (randomization): patients must be offered the opportunity to participate in specimen banking. * step 1 registration (randomization): patients must be informed of the investigational nature of this study and must sign and give written informed consent for this protocol in accordance with institutional and federal guidelines. * step 1 registration (randomization): as a part of the oncology patient enrollment network (open) randomization process the treating institution's identity is provided in order to ensure that the current (within 365 days) date of institutional review board approval for this study has been entered in the system. * step 2 registration (surgery): patients randomized to arm 2 (neoadjuvant arm) must be willing to submit tissue to determine pathologic response regardless of number of pre-operative doses of pembrolizumab (mk-3475) received. determination of pathologic response cannot be done on less than the full surgical specimen. * step 2 registration (surgery): patients must have disease assessments by ct chest/abdomen/pelvis with iv contrast, and neck ct with iv contrast if primary head and neck melanoma, performed within 42 days (and no more than 49 days) before the planned date of surgery. mri combined with non-contrast ct is an acceptable alternative for patients with ct contrast allergy, but imaging must encompass total body. * step 2 registration (surgery): patients must register to step 2 within 17 days prior to planned date of surgery. * step 3 registration (adjuvant therapy): patients must have undergone surgery prior to step 3 registration. the step 2 surgery must have completely resected their melanoma. * patients with gross positive residual disease following surgery do not qualify as having disease-free status, and, therefore, such patients are not eligible to register for adjuvant therapy. * patients with microscopic residual disease (i.e., positive margins) can be treated with re-excision or radiation, per site discretion, to render the patient disease-free prior to registration of adjuvant therapy. * disease-free status must be documented by a complete physical examination and radiographic imaging studies within 42 days prior to step 3 registration. imaging studies must include a ct of the chest, abdomen, and pelvis (unless contraindicated). extremity melanomas must be imaged using ct with intravenous contrast or mri with and without gadolinium. ct imaging must be done with intravenous contrast if there are no contraindications for it. * for patients with melanoma arising from the head and neck, dedicated neck imaging (ct with iv contrast, unless contraindicated) is required. * if the patient has had unknown primary with disease in the axilla, neck imaging is required to assure the region is clear of cancer. * any other clinically indicated imaging studies if performed (e.g., bone scan) must show no evidence of disease. * step 3 registration (adjuvant therapy): patients must be registered to step 3 no more than 84 days after date of surgery. * step 3 registration (adjuvant therapy): patients with r0 or r1 resections must have disease-free status documented by a complete physical examination and imaging studies within 42 days prior to step 3 registration. these patients must have disease assessments by ct chest/abdomen/pelvis with iv contrast, and neck ct with iv contrast if primary head and neck melanoma. mri combined with non-contrast ct is an acceptable alternative for patients with ct contrast allergy, but imaging must encompass total body. * step 3 registration (adjuvant therapy): patients with r2 resections are not eligible for step 3 and must be removed from study treatment