As it is known that electron-releasing group increases the basic strength and electron withdrawing group decreases the basic strength of $- NH _{2}$ group.
As in
group is planked between two electron withdrawing groups, compound (1) is least basic among all. In compound $(2),- NH -$ is attached with one electron withdrawing group $- CO -$ and one electron releasing group $- CH _{3}$, it is a bit basic than compound
(1). In compound (4)- COCH $_{3}$, group is attached to aniline ring, not directly with $- NH _{2}$ group.
Hence it is more basic than compound (2). Compound (3) is most basic among all compounds since in it, $- NH _{2}$ is atached to only one electron releasing group $\left(- CH _{2}-\right)$. Thus, the correct order of basic strength will be