Managing the Clock in an Interview
Time management in an interview is dividing a round into small blocks for planning and coding and checking. It keeps the solution finished before the round ends.
A 45-minute plan
The plan below divides 45 minutes into four blocks.
plan = [("Plan", 10), ("Code", 25), ("Check", 5), ("Buffer", 5)]
total = 0
for name, minutes in plan:
print(name + " " + str(minutes))
total = total + minutes
print("Total " + str(total))Minutes left
Subtracting used minutes from the total shows the time left.
total = 45
used = 20
left = total - used
print("Used " + str(used))
print("Left " + str(left))A stuck rule
A simple rule stops one step from eating the whole round.
minutes_on_step = 12
if minutes_on_step > 10:
print("Move on to the next step")
else:
print("Keep working")Example
plan = [("Plan", 15), ("Code", 30), ("Check", 10), ("Buffer", 5)]
total = 0
for name, minutes in plan:
print(name + " " + str(minutes))
total = total + minutes
print("Total " + str(total))Key points
- A planning block comes before any code is written.
- A coding block turns the plan into working code.
- A checking block tests the code on small inputs.
- A buffer block stays free for surprises and fixes.
- A stuck step should move on after a few minutes.
- The clock is checked at the end of each block.
The program stores a 60-minute round as four blocks. It prints each block and adds the minutes into a total. The final line confirms the blocks add up to 60.
Try it Yourself
Edit the code, then press Run.
Running is simulated · Python Playground
Exercise
A 45-minute round has 25 minutes spent on planning. What is the main risk?