Solving for impulse response h[n] given input-output pairs
Without any generalizations, this particular problem could be solved with the following: Let the causal FIR impulse response of the LTI system be $h[n]$ of length $L$, which can be inferred from the first set that $L = 4$, hence let the impulse response be $$ h[n] = \{a,b,c,d\} $$

Then from the first set, it can be seen that
$$y[n] = h[n]+h[n-2] = \{a,b,c+a,d+b,c,d\} = \{0,1,0,2,0,1\}$$

from which you can deduce that $$a=0 ~,~ b=1 ~,~ c=0 ~,~ d=1 $$ which confirms that your result was right. For a longer impulse response you would need to solve a more involved set of (linear) equations...