Amazon interview question

write a small api to read strings