Solving for impulse response h[n] given input-output pairs This is a homework problem that I've worked on and I want to confirm some of my reasoning. 

I'm given two sets of input-output pairs of a particular system, $S$, that we know is linear time-invariant (LTI). Given those two pairs, find the impulse response h[n] of the system:

$$x_1[n] = [1, 0, 1] * S \longrightarrow y_1[n] = [0,1,0,2,0,1]$$

$$x_2[n] = [0, 1, 1] * S \longrightarrow y_2[n] = [0,0,1,1,1,1]$$

I found a linear combination of both inputs to yield the delta:

$$\delta[n] = x_1[n] - x_2[n-1] = [1, 0, 0]$$

Due to the system being LTI, the output to the delta is:

$$y[n] = h[n] =  y_1[n] - y_2[n-1] = [0,1,0,1,-1,0]$$

Since the input is 3 samples long and the output is 6 samples long, then my impulse response $h[n]$ has to be 4 samples long. So I discard the last two to finally yield:

$$h[n] = [0,1,0,1]$$

Convolving the input signals with the newly found $h[n]$ yields the given output signals. I am however uncomfortable with having to invoke the required length of $h[n]$ to yield its final form by deleting the last two samples.

Did I go wrong somewhere?
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...