You answered The correct answer is Your doctor may perform an endoscopy to check for more serious problems, says the NIDDK. During an endoscopy, a long, thin tube is inserted down your esophagus and into your stomach to check for ulcers in the esophagus or stomach, or other problems.