The Sphinx never asks Harry Potter any riddles in the book or film series. The Sphinx is a creature from Greek mythology (Oedipus legend), not a character in J.K. Rowling's Wizarding World.
You may be thinking of a different magical creature or puzzle in the series:
Clarify the scene or creature you have in mind for a precise answer.