Step 1: Reduction of nitrobenzene.
The starting compound is nitrobenzene.
On treatment with
\[
H_2/Pd
\]
nitrobenzene is reduced to aniline.
\[
C_6H_5NO_2 \xrightarrow{H_2/Pd} C_6H_5NH_2
\]
Step 2: Acetylation of aniline.
Aniline reacts with acetic anhydride in pyridine to form acetanilide.
\[
C_6H_5NH_2 \xrightarrow{(CH_3CO)_2O,\ pyridine} C_6H_5NHCOCH_3
\]
Therefore,
\[
X=\text{acetanilide}
\]
Step 3: Bromination of acetanilide.
Acetanilide undergoes bromination with
\[
Br_2/CH_3COOH
\]
The \(-NHCOCH_3\) group is ortho-para directing.
Due to steric hindrance, the para product is major.
Thus, the major product is
\[
p\text{-bromoacetanilide}
\]
Step 4: Hydrolysis of bromoacetanilide.
On hydrolysis,
\[
p\text{-bromoacetanilide}
\]
gives
\[
p\text{-bromoaniline}
\]
Step 5: Carbylamine reaction.
Primary amines react with chloroform and alcoholic KOH on heating to give isocyanides.
Thus,
\[
p\text{-bromoaniline}
\xrightarrow{CHCl_3,\ KOH,\Delta}
p\text{-bromophenyl isocyanide}
\]
Therefore,
\[
Y=p\text{-bromophenyl isocyanide}
\]
Step 6: Final conclusion.
Hence,
\[
\boxed{X=\text{acetanilide},\quad Y=p\text{-bromophenyl isocyanide}}
\]
Therefore, the correct option is (4).