Most curveball questions don't have one exact answer. They're designed to suss out if you're a fit for the culture, to get a window into your personality or to get a sense for your creativity.
In these cases, consider what sort of qualities or traits your interviewer is trying to reveal with an oddball question and answer accordingly. Interviewers use your responses "to get a sense of [your] personality and to gauge if [you'll] be a good fit with the company," says Augustine.
Some curveball questions will have a correct answer, like Elon Musk's riddle, one based on scientific principles. Try searching for the most popular oddball interview questions to get a sense of possible responses. While it's impossible to fully prepare for every potential question, you can at least practice answering some of the more common ones to help you practice logically thinking through an answer you might give on the spot.