Designing Sring Tokenizer Function

Are we asked in interviews or in any competitions to design our own functions like this?

hello @tanyaa.sood
yeah interviewer can ask such questions