  Let $W\subset \mathbb {P}^n$, $n\ge 3$, be a degree $k$ hypersurface.
Consider a "general" reducible, but connected, curve $Y\subset \mathbb {P}^n$,
for instance a sufficiently general connected and nodal union of lines with
$p_a(Y)=0$, i.e. a tree of lines. We study the Hilbert function of the set
$Y\cap W$ with cardinality $k\deg (Y)$ and prove when it is the expected one.
We give complete classification of the exceptions for $k=2$ and for $n=k=3$. We
apply these results and tools to the case in which $Y$ is a smooth curve with
$\mathcal {O}_Y(1)$ non-special.
