A mixture containing the following four compounds is extracted with 1 M HCl. The compound that goes to aqueous layer is:

Extraction with 1 M HCl separates compounds based on their basicity. Basic compounds react with HCl to form water-soluble ammonium salts, which partition into the aqueous layer.
Among the given compounds, only compound (II) contains a basic amine group. It reacts with HCl to form the corresponding ammonium salt:
This salt is soluble in water and therefore transfers to the aqueous layer.
The other compounds (thioether, ether, and ketone) are non-basic and remain in the organic layer.
Tagged Acidity and basicity of organic compounds. Machine-assigned, so read it as a strong shortlist rather than a verdict.