Member-only story

Senior Engineers Should Learn How To Stop The Horse

Samuel Teixeira
3 min readJul 4, 2023

--

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.

LeetCode problem with hidden information

You received this requirement and now must deliver the code to resolve it.

Saving you a tweet view

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?

--

--

Samuel Teixeira
Samuel Teixeira

Written by Samuel Teixeira

Developer (15+ years) | Staff Engineer at IAS | Master of Computer Science | Interests — Backend Dev , Machine Learn, Code performance, System Design

Responses (1)