Member-only story
Senior Engineers Should Learn How To Stop The Horse
First, solve the problem. Then, write the code
This is not about Leetcode and interviews, but I will use it to create my point. This is about how we handle ambiguous or incomplete requirements.
You received this requirement and now must deliver the code to resolve it.
First Solve the Problem
Imagine you are doing an interview, and you have the requirements above.
What do you do next? Ask clarification questions!
Could you explain what we are returning exactly?
- Is the first number that appears three times?
- Is the number that does not appears three times?
The person will tell you that you need to return the element that does not repeat.
What should be the runtime complexity, and what we can use as additional space?
Then, write the code.
What could happen if you don’t ask for that clarification questions?