some algorithms for interview