Microsoft interview question

Write a function that determines whether a given number is a prime. Discuss perf improvements.

Interview Answers

Anonymous

11 Mar 2011

I come form math background so this was a goldmine for me. I started with a brutforce solution, then jumped to a hash table + brutforce and then discussed some of the less known solutions, like AKM algorithm.

Anonymous

6 May 2011

Did you mean the AKS algorithm?