If interviewer asks a problem and you come up with some solution say of O(n) time complexity with iterating twice over an array. But optimized solution involves just one iteration. Should you ask interviewer if the approach you told is fine or if it can be done with lesser avergae time complexity. Or you yourself have to figure out that whether your approach is good enough?