Can solving too many hard problems hurt your interview?
Generally, no. However, be mindful of the situation in this post.
Hard problems can make you worse at some easy problems!
Take a look at these two questions:
- (Hard Problem) Calculate the Edit Distance between two given strings.
For example, the edit distance between “cat” and “cog” is 2 - it requires two substitutions: a -> o and t -> g.
- (Easy Problem) Find if the Edit Distance between two given strings is 1.
For example, the edit distance between “dog” and “dogs” is 1 - it requires one insertion - the letter s.
The first problem - Finding Edit Distance - is well known. It’s a hard problem, usually solved using Dynamic Programming.
Here’s what we’ve observed:
Let’s say a candidate has practiced the 1st problem.
When we ask them the 2nd problem, they approach it via Dynamic Programming, even though it’s unnecessary.
In their mind, the 2nd problem is a variation of the first, so naturally, it should be solved with a similar technique, right?
Wrong! The second problem is much simpler!
Yet many candidates fall into this trap. They apply a solution prematurely - without digging deeper into the specific problem.
Luckily, you can avoid this - when you get a new problem that sounds familiar, don’t get too excited.
Don’t just try to recall a solution.
Instead, solve the problem from scratch. Take examples and try to understand the problem’s components.
With this process, you will find a solution naturally - even if it’s the same solution you’ve seen before.
Now obviously, this advice doesn’t apply to all situations. In general, solving hard problems is good for your problem-solving skills.
Just be mindful and don’t ignore easier problems.
“When all you have is a hammer, everything looks like a nail” - Law of the instrument
Originally posted on Quora