"How would you check if a number is prime? Walk through the logic, edge cases, and the time complexity of your approach."