A2SV G5 Lecture The 7 Steps of Highly Effective Problem Solving
A2SV G5 Lecture The 7 Steps of Highly Effective Problem Solving
Problem Solving
If we want to perform well in the interviews with top tech
companies, we need to prepare and play with the best
tactics.
1. Understand
the Problem
If you understand something different than what is asked, the odds
If you don't know how to solve the problem for small input, how
can you tell a computer to solve it at scale?
Sometimes, solving it by hand reveals some patterns that
are key to the programmatic solution.
The big picture and patterns are not always visible at first
glance.
At this step, it is important to check your algorithm’s time
and space complexity, including the helper functions
you use
..
Rookie mistake
Ask yourself, how can I break this idea? Can you come up with an
input that breaks it? Try to target it logically, what can be an edge
case for it?
TIP
A tip that can be useful for coming up with edge cases is going over your
proposed solution and looking for assumptions you might have made.
total -= curr
Testing is not just coming up with obvious edge cases like null nodes,
empty arrays, or zero values. It is also not trying some random cases.
Each test case you try should have a motivation.