From an interview book, where the answer is not so clear I believe. You keep generating $\mathcal U_{[0,1]}$ iid random variables until their sum exceeds 1, then compute the expected value of the last random variable, i.e. the one responsible for letting the sum of rvs overflow 1.
My idea (not working):
The $i$-th draw from $\mathcal U_{[0,1]}$ is called $X_i$, and $S_N:=\sum_{i=1}^N X_i$.
I aim to compute: $$\mathbb E\left[X_{N}\right], N:=\min \left[i:\sum_i X_i > 1\right].$$
Rewrite it as: $$\mathbb E\left[X_{N}\right] = \sum_{i=2}^\infty \mathbb E\left[X_{N}|N=i\right]\mathbb P[N=i].$$
From this question I know that $\mathbb P[N=i] = (i-1)/i!$.
I know that $X_N$ takes positive values between 0 and 1, so I use the expectation of the tail function: $$\mathbb E\left[X_{N}|N=i\right]=\int_0^1 \mathbb P[X_N>t|N=i]\ \text d t= 1-\int_0^1 \mathbb P[X_N\leq t|N=i]\ \text d t.$$
Now, some relabeling, using $X$ for the generic $\mathcal U_{[0,1]}$ and $Y$ for $S_{i-1}$: $$\mathbb P[X_N\leq t|N=i]=\mathbb P[X_i\leq t|S_{i-1}<1 \cap S_{i-1}+X_i> 1]=\mathbb P[X\leq t|Y<1 \cap X> 1-Y].$$
Now reversing the conditioning: $$\mathbb P[X\leq t|Y<1 \cap X> 1-Y] = \frac{\mathbb P[X\leq t\cap X> 1-Y|Y<1]}{\mathbb P[X> 1-Y|Y<1]}.$$
Now, from the same interview book I know that $\mathbb P[S_N\leq y|S_N < 1]=y^N$, so the density function of $Y|Y<1$ ends up being $(i-1)y^{i-2}\ \text dy$.
By total probability, conditioning over the value of $Y$, I write: $$\mathbb P[X\leq t|Y<1 \cap X> 1-Y] = \frac{\int_0^1\mathbb P[X\leq t\cap X> 1-Y|Y<1, Y=y](i-1)y^{i-2}\ \text dy}{\int_0^1\mathbb P[X> 1-Y|Y<1, Y=y](i-1)y^{i-2}\ \text dy}.$$
The numerator leads to the integral: \begin{equation}\tag{error is here!} \int_0^1\mathbb P[X\leq t\cap X> 1-Y|Y<1, Y=y](i-1)y^{i-2}\ \text dy=\\ \int_0^1(t-1+y)(i-1)y^{i-2}\ \text dy=\dots=t-1+\frac{i-1}i. \end{equation} The denominator similarly: $$\int_0^1y(i-1)y^{i-2}\ \text dy=\dots=\frac{i-1}i.$$
Substituting: $$\mathbb P[X>t|Y<1 \cap X> 1-Y] =1 - \mathbb P[X_N\leq t|N=i]=i\frac{1-t}{i-1},$$
$$E\left[X_{N}|N=i\right]=\int_0^1 \mathbb P[X_N>t|N=i]\ \text d t=\int_0^1 i\frac{1-t}{i-1}\ \text d t=\frac{i}{2(i-1)}$$
$$\mathbb E[X_{N}] = \sum_{i=2}^\infty \mathbb E[X_{N}|N=i]\mathbb P[N=i]=\sum_{i=2}^\infty \frac{i}{2(i-1)}(i-1)/i!=\dots=\frac{e-1}2.$$
The answer should be (verified via MC) $2-\frac e2$.
Would you mind checking my procedure and letting me know where it is wrong?
EDIT: Found the problem thanks to two answers below, adding for completeness.
The probability $P[X\leq t\cap X> 1-Y|Y<1, Y=y]$ should actually be written as (answer by Noble Mushtak):
$$P[X\leq t\cap X> 1-Y|Y<1, Y=y]=\\ =P[X\leq t\cap X> 1-Y\cap 1-Y<t|Y<1, Y=y]=\\=P[1-Y<X\leq t|1-t<Y<1, Y=y]P[1-t<Y<1|Y<1, Y=y]=\\=(t-1+y)\int_{1-t}^1(i-1)y^{i-2}\ \text dy=\dots$$
If so, then (also found by Amir):
$$\mathbb E[X_{N}|N=i]=\frac{i+2}{2(i+1)}.$$