Let $Y=X+W$ where $X\sim U[a,b]$ ($X$ does not have to be independent of $W$). If $Y$ has the following distribution, what distribution should $W$ have?
\begin{align*} f_Y(y) = \begin{cases} c_0,~&\mbox{if }a\leq y<d_1\\ c_1,~&\mbox{if }d_1\leq y<d_2\\ c_2,~&\mbox{if }d_2\leq y\leq b \end{cases} \end{align*}
I feel that $W$ should depend on $X$, i.e., if $X\in[x_0,x_1]$, then $W$ is some random variable and when $x\in[x_1,x_2]$, $W$ has a different distribution. I did some numerical example. Although I haven't figure out what $W$ is, but I think intuitively, $W$'s density should look like triangle. I find that if $W$ is a uniform, then the density of $Y$ always have some triangle. So I feel that the only way to make those triangles in the density of $Y$ become rectangle, probably the only way is to make the density of $W$ to have some triangles.