That's the idea, yes. However none but OpenAI knows exactly what ChatGPT was trained on. In fact, the dataset that it was trained on is so vast that they probably don't know either if it contains any given question.
IIRC last week I saw a study where GPT4 can solve some leetcode problems simply by giving it the number, no description. A clear example of overfitting.