Veeva Systems interview question

C++ coding exam. In the technical interview, was asked to code a text truncating algorithm for displaying text on a phone screen.