coding test with no 3rd party lib usage