Fast Enterprises Interview Question

Write the implementation for a prime factorization algorithm. What ways could you make this algorithm more efficient?