Epic interview question

Given an integer M. return all prime numbers smaller than M.