  Consider two or more strings $\mathbf{x}^1,\mathbf{x}^2,\ldots,$ that are
concatenated to form $\mathbf{x}=\langle \mathbf{x}^1,\mathbf{x}^2,\ldots
\rangle$. Suppose that up to $\delta$ deletions occur in each of the
concatenated strings. Since deletions alter the lengths of the strings, a
fundamental question to ask is: how much redundancy do we need to introduce in
$\mathbf{x}$ in order to recover the boundaries of
$\mathbf{x}^1,\mathbf{x}^2,\ldots$? This boundary problem is equivalent to the
problem of designing codes that can detect the exact number of deletions in
each concatenated string. In this work, we answer the question above by first
deriving converse results that give lower bounds on the redundancy of
deletion-detecting codes. Then, we present a marker-based code construction
whose redundancy is asymptotically optimal in $\delta$ among all families of
deletion-detecting codes, and exactly optimal among all block-by-block
decodable codes. To exemplify the usefulness of such deletion-detecting codes,
we apply our code to trace reconstruction and design an efficient coded
reconstruction scheme that requires a constant number of traces.
