Compounds X (p ~ 15) and Y (p ~ 10), both produce on treatment with sodium metal and both yield a mixture of isomers on mononitration. X and Y respectively are

From the NSE 2018 · NSEC · Chemistry paper. Try it, check your answer, then read the worked solution below.
Compounds X (p ~ 15) and Y (p ~ 10), both produce on treatment with sodium metal and both yield a mixture of isomers on mononitration. X and Y respectively are

Try it yourself first, then check your working against this.
Worked solution
Both react with Na, so both have an O-H.
X = I, Y = III.
(D)
Concepts used: acidity of alcohols vs phenols, directing effects in nitration
Every past question tagged to the same part of the syllabus, with solutions.
Past questions on the same topic (Phenols), each with a worked solution.
Timed, in the real format, and marked the moment you submit.