Step 1: Understanding the Concept:
Tollen's reagent is a freshly prepared solution of silver nitrate in excess ammonia, that is the complex ion \( [\mathrm{Ag(NH_3)_2}]^{+} \) in a basic medium. It is a mild oxidising agent. The question asks which class of compound gives a positive test with it.
Step 2: Key Formula or Approach:
A mild oxidising agent oxidises only those compounds that are easily oxidised. Aldehydes (the \( \mathrm{-CHO} \) group) are easily oxidised to carboxylate ions, and the silver(I) ion is reduced to metallic silver. The silver deposits on the wall of the test tube as a bright mirror.
\[ \mathrm{RCHO + 2[Ag(NH_3)_2]^{+} + 3OH^{-} \xrightarrow{\Delta} RCOO^{-} + 2Ag\downarrow + 4NH_3 + 2H_2O} \]
Step 3: Check option (1), Alcohol.
A simple alcohol is not oxidised by the mild \( [\mathrm{Ag(NH_3)_2}]^{+} \) ion, so no silver mirror forms. So (1) is wrong.
Step 4: Check option (2), Aldehyde.
An aldehyde reduces Tollen's reagent and gives the silver mirror, as the equation in Step 2 shows. It is the standard test used to tell aldehydes from ketones. So (2) is correct.
Step 5: Check option (3), Ketone.
A ketone has no hydrogen on the carbonyl carbon, and it is not oxidised under these mild conditions. It gives no silver mirror. So (3) is wrong.
Step 6: Check option (4), Carboxylic acid.
A carboxylic acid is already in a high oxidation state and does not reduce Tollen's reagent. The only well known exception is methanoic acid, which still carries an aldehyde type \( \mathrm{-CHO} \) group, but the general class does not respond. So (4) is wrong.
Final Answer:
Tollen's reagent identifies an aldehyde, option (2).
\[ \boxed{\text{(2) Aldehyde}} \]