Both the question mark in the first sentence and the period in the second are required. The first sentence should not have a period, and the second should have only one, preferably inside the quotation marks.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.