Amazon Interview Question

write a small api to read strings