Pocket FM Interview Question

Shared codeshare link with python code and asked to refactor the code