UMPIRE Interview Strategy CodePath Cliffnotes
UMPIRE Interview Strategy CodePath Cliffnotes
UMPIRE Interview
Strategy
Edit Page Page History
Introduction
During a technical interview, the way you
work towards your solution is often more
important than the binary result of solving the
problem or not. There are several good ways
to show and communicate your work as you
work through an algorithm problem. The
UMPIRE method is another way to state the
best practices that underlie the most
successful approaches in a catchy name.
UMPIRE Example
Let's practice using the UMPIRE technique
on the following problem.
Understand
Test Cases
Input: 1; partition = 1
Output: 1
Questions
Match
Linked List problems are usually some of the
easiest to spot and so matching this to the
Linked List category is a good choice. So we
know we would like to employ Pointer
Bookkeeping during the algorithm planning.
So let's list out all the things that we might
consider and our belief of match Likely,
Neutral, Unlikely.
Implement
If our plan stage was successful, we should
be able to implement the code by simply
glueing the plan together while filling out the
details of our language specific
implementation. I like to write my
implementation out in layers, where the first
layer is me writing basic setup code and then
talking to the pieces of the plan.
Review
The very important, but too often skimped on,
review stage is next. Unfortunately, most
interviewees just skim through the code to
say yeah that looks right, but that IS NOT
what review means. It means go through it as
if you are debugging it, assuming there is a
bug. If you do you woudn't just be saying
yep, thats what I'd meant to write. Instead,
you would be bringing the big debugging
"guns". Watchlist of variables and stepping
through the code line by line are the typical
tools of choice to go for this stage.
Happy Path
Edge Cases
Evaluate
The last step of the UMPIRE strategy is to
discuss the pros and cons of your algorithm
with your interviewer. An algorithm much like
a good interview is not amenable to
correct/incorrect label, instead there are often
things to discuss about what you like about
your algorithm or code and what you would
like to change depending on conditions,
inputs, expectations, the business, etc. A
great place to start this conversation and is
almost always required is to discuss the
asymptotic performance of the algorithm.
Let's evaluate our algorithm. To do this, let's
start with any loop statements. We have two
loop statements. The first, is iterating the r
pointer until it reaches the first node on the
right side. In the best case, this wouldn't go
further than the first position, in the worst
case we would go to the end of the list
without finding a right node. So this loop has
O(N) time complexity where N is the length
of the list.