Imagine you are an engineer on a spaceship. This is a big and complex interstellar spaceship. You work in the machinery and take care of the engine. Your everyday work includes:

  • working with the engine parts 
  • adding new ship parts
  • fixing parts 
  • and changing parts

There are some parts you specifically love to work with and specialize in them. You are an excellent spaceship machinery engineer and everyone recognizes you for your skills, especially other engineers. 

You barely talk with other ship crew departments. Sometimes you meet with the pilot crew, but very rarely talk with the 1st and 2nd pilots, they seem very busy. Most often you talk with the 3rd pilot and 3rd co-pilots.

In this engineer position, you have a vague understanding of how the whole ship functions, what is the ship’s purpose and what is the next destination. The only thing you care the most about is the engine, that it works and the ship flies.
There is a special room in machinery, with the big sign Flow on it, and this is the room where you can spend all day with your headphones on, working with the engine.

 

One day you are promoted to the 3rd co-pilot. 

 

And now your new workplace is in the pilot’s crew room. Your everyday workday changed. 

You sit in your new workplace and it looks like this cockpit with many buttons. 

cockpit

cockpit

You press some buttons daily and adjust some parameters, but do not always see immediate results from your actions. Sometimes you do not understand:

  • what are you doing???
  • what is going on on the ship???
  • does anybody understand what they are doing???

Time passes, you undergo some pilot training courses and you attend more pilot crew meetings. Suddenly you start to get a better idea about why the ship has an engine at all. You hang out more with the 3rd co-pilot and get an even better idea about all the engine part’s purposes on a higher level.
You notice, that still every time you talk with other engineers about the engine or have time to go back to machinery and play with some parts – that is what makes you happy. And especially when you work with your favorite engine parts.

 

Another day, by an unforeseen set of circumstances, 3rd pilot is gone. Some say he was abducted by aliens, some say he ran to another spaceship for better cookies.

But guess what? You are the 3rd pilot now.

How it feels like when you go into management from a senior engineer position

How it feels like when you go into management from a senior engineer position

Now your everyday work changes again. You talk more with the 2nd co-pilot, still rarely seeing the 1st one, but you talk more often in meetings with them. You are not allowed to go to the machinery at all anymore. Even if you could, you have no time for that. Now you have your own 3rd copilots who talk with engineers, and you can talk about the engine only with them.
You have noticed, that 1st and 2nd pilots have a vague understanding of how the engine works, still, they are ruling the whole ship.
You notice, that still every time you talk with 3-rd copilots about the engine – that is what makes you happy. And especially when you talk about your favorite engine parts.

 

Sometime later you fully understand the ship’s purpose and every next destination. In a meeting with the 1st and 2nd pilots, you got an explanation, that there are several ships in this galaxy, that are similar, but not the same. These ships have different engines, but the same goal. They travel from one star to another one and collect passengers. The better a ship’s engine is, the faster it can travel, and the more passengers it can collect. And the more passengers it collects – the more successful the ship is (and it makes the 1st pilot happy.) Each ship has a tickets sale department, and they need a good engine to reach new stars faster and sell passengers tickets to our ship.

You learned, that your responsibility is to help with the engine development and that some of the parts requests are coming from passengers.

 

One day you are on an urgent meeting with the 1st and 2nd pilots.
2nd pilot tells you, that there is a passenger we picked up from a big bright star, and he is unhappy. This passenger needs a new engine part and another one to be fixed.

You know that what is usually required from you is to provide information on rough estimation and if it can be done. Easy peasy. 

You know from your old days experience in machinery that this task would require 5 days to be done properly. 

  • “We need 5 days to do it in machinery, to do it right and robustly”. : you say

(And you notice the 1st pilot looks not happy.) 

  • “What information do we have from the ship tickets sales department?” : he asks the 2nd pilot
  • “Well, the passenger might leave for another ship if we are not on time…”: the 2nd pilot answers

The 1st pilot turns to you and says

  • “Look, I see the given estimation, sorry but… (we tend to trust the ticket sales department more) we have to do it in 2 days.
    Otherwise, this passenger is gone, and if he is gone, then the engine will explode, the ship will explode and we are all going to die.”

And you feel a ‘little bit’ of pressure.

1st pilot continues, he grabs you over the shoulder, points a finger to the empty space, and tells you

  • “Look, Oleg, there is this distant bright start, and if we reach it, all our problems will be solved…”
typical manager

typical manager

You leave the meeting motivated and in deep thought on how to deliver the requested task in 2 days. You are on your way to speak with your 3rd copilots and being deep in your thoughts, you skip the right corridor. 

In the next corridor, you stumble on Gregor, a machinery engineer. You remember Gregor from your past work in machinery together and you know, that he specializes exactly in the parts you need to work on.

Gilfoyle

Gregor

  • “Hey Gregor, how are you?” : and you smile because you learned people skills now

Gregor moves his headphones down, he tells you he is okay.

You know, that you are about to disappoint Gregor, and you are smiling even more. 

  • “Look, Gregor, we have an urgent project and I think you are the best person to solve it. You are our very best engineer in the machinery.”

But Gregor doesn’t look enthusiastic. He tells you, that he is already working on another very urgent project with a one-week deadline, given to him by the 2nd pilot directly.

(You are wondering – “nobody told me about that project”)

Actually, Gregor just was in a Flow room and left for a minute.
– “But there is this new guy Dave in the machinery”: he tells you 

– “Who is the most suitable for the task.”
Gregor puts his headphones back with these words and leaves into the Flow room.

Dave

Dave

Well, you are already close anyway and decided to go straight to the machinery visit Dave

  • “Hey Dave, how are you?” : and you are smiling again

Dave looks very enthusiastic. He tells you about 5 tasks he has on his list and that he works on one by priority and makes great progress right now, then he proceeds with the technical details.

You know, that you are about to disappoint Gregor, and you are smiling even more.

  • “Look, Dave, we have this urgent task, and we have only about 2 days to accomplish it, otherwise, the engine will explode and we are all going to die…”

And you know, that at this moment Dave feels a little bit of pressure. But in your pilot crew training, you have acquired Emotional Intelligence and you know what to do.

You grab Dave around the shoulder, point your finger to the empty space and proceed:

  • “Look, Dave, there is this distant bright star, and if we reach it, all our problems will be solved…”

 

Long story short, this is the outcome:

  • Dave was able to deliver the task in 2 days with the dirty hack. The engine did not explode, but that part started to work slower and the machinery team could not fix it for the next light year
  • Gregor decided to do a big engine refactoring and was 2 weeks late with his project, but apparently, that project wasn’t as urgent as he was told initially and it was fine
  • You haven’t seen the 1st pilot for the next 2 months, he was very busy
  • You started to have a sense of purpose in your new role and feel productive, especially during meetings with the 2nd pilots and your co-pilots

The end!

knight distance

First time I faced this problem during one of my codility tests for a work application. And I failed it. :) Just because I have never heard about such problems before. Anyway, my opinion about codility tests is the same as about writing code on a whiteboard.  A programmer should be able to think, to investigate and solve the problem in the end. You can’t train yourself for every existing problem and their endless variations. It’s true especially for whiteboard coding challenge because you have limited time and can’t use online resources. Stress not compliment process of thinking, it destroys this process. Well, it’s a topic for another post. In this post, I will provide my investigation on a Knight distance problem and a solution.
Continue reading