What Google Hashcode 2021 Taught Me About Management
Unknown (https://storage.googleapis.com/gweb-uniblog-publish-prod/images/Google_Students_feed_post.max-1000x1000.jpg)

What Google Hashcode 2021 Taught Me About Management

Valuable lessons I learned in 4 hours to delivery from Google Hashcode 2021

What is Google Hashcode?

Google Hash Code is a team programming competition, organized by Google, for students and professionals around the world. You get to pick your team and programming language (they encourage you to use whatever language you and your team are comfortable with) and they provide you with an engineering problem for you and your team to solve. These problems are typically in the optimization space.

TL;DR

  • Spend the time planning, this will save you time, even if you think you are behind! My suggestion on that is; step away from the computer and write out the steps you need to complete the task in words - because programmers wanna program (we need to slow down sometimes).
  • Make sure you know what you are trying to achieve and have a mutual understanding of the task, as a team.
  • Make sure you define your deliverable and what you are, actually, trying to "solve for".
  • Know your Inputs, Outputs and Constraints. Group them and make sure your team understands the data structure you end up with, once you process the data.
  • Test often
  • Leave enough time to submit

What was the task? And why knowing what you are trying to achieve really matters (and when it doesn't)

This year's task was related to Google maps and traffic lights schedules.

Given the description of a city plan and planned paths for all cars in that city, optimize the schedule of traffic lights to minimize the total amount of time spent in traffic, and help as many cars as possible reach their destination before a given deadline.

Learning 1:
Define what the problem is and make sure the team has a mutual understanding of the task.
Define the deliverable (in this case what we are optimizing for)

In this Hash Code, my and I team did not necessarily have a mutual understanding of the (mostly I was trying to optimize for the wrong thing and wasted much time). If we had taken the time to discuss the task beforehand and what the actual goal is (related to the output we needed to give) we may have gotten a lot further.

They (Google Hash Code Organizers) provide you with a bunch of details about the problem including; simulation time (deadline), traffic lights, intersections, roads, cars, routes etc. as well as a flat-file with these details. Since this article is not about those details I am not going to break them all down here, but what is important here is to define the variables and group them.

Learning 2:
Know your Inputs, Outputs and Constraints
Group them into understandable 'objects'

This will help you to define your data structures. Once we defined the inputs, we grouped them together (into roads, cars and robots) allowing us to make sure the related data is easily accessible when we needed it.

We found a great optimization in data structure here, because the routes a car took were provided as a name, so we stored the 'roads' object data with a key of the road name and then all the required values as an object nested into that key, meaning while importing the car data we could simply fetch the related route road data, without having to loop through them again.

One big mistake we made here was the object notation we used, was not familiar to the rest of the team. So, while this structure was more computationally optimal, it introduced more errors into our code because we did not all have a shared understanding of the data structure that I had created (my bad and sorry Daniel).

The importance of planning

Planning here is not just about the data, it is about taking the time to write down the steps to achieve your goal and solve the problem.

Lesson 3:
Write down the high level steps needed to achieve the goal.
Clarify areas that are not clear to you or other members of the team.

This simple process will allow you to:

  • Work out some of the details needed - in this case, help define a fitness function upfront (something we never quite got to finish, because we allocated our time ineffectively)
  • Know the order of operations
  • Create the simplest solution (think MVP) that you can submit
  • Divide up the work (so that one person is not necessarily doing all the coding)
  • Include other members of the team, and allow those not as technically strong to contribute
  • Not waste time on work that is not needed
  • Optimize the solution as a secondary part (once you have your MVP)

Remember explaining something to someone else can be less effort than doing the work, and help make sure you understand the task, problem and solution well.

In this Hash Code we did not divide up the work well and, sometimes wasted time - almost doing double work at times.

Test, Test and Test Again

Learning 4:
Test Often!
Don't try and do it all in 1 sitting, print and look at the results, often, then talk about what you see for a sense check.

The chosen language we had, was neither of the people who actually coded the projects most familiar language. Don't make the technology decision to try and be inclusive (unless that is the personal goal of the team). Rather pick the one you know well. 4 hours is not a long time to finish, and we spend quite a lot of time fixing syntax errors that look correct because other languages we know; work that way.

This also gets you feedback sooner. the sooner you hit Run, the sooner you get feedback, the sooner you can fix the issues, or change direction. Don't be precious, feedback is more important (especially if the code does not even run and you now need to find out what the issue is just before submission).

Submit on time, and in the correct format

Learning 5:
Leave enough time to submit

Sadly, despite all our hard work, we missed the submission date. Make sure you have enough time to prep and put your files and data into the correct format for the submission. These were separate files that needed to be submitted, so our "print" statement for output did not quite work and we missed it because we were not ready for that. If you discuss this upfront (from learning 1) you can plan to have that functionality ready before you need to submit it.

Conclusion

I hope that someone can take value from these learnings, as it is applicable in your day to day tasks. When someone gives you a task to do at work or a larger project, these same lessons can be applied.

Hope that helps and I definitely would like to try Google Hash Code next year with a new (and improved) approach

June Julyan

Business Development at BankservAfrica

4 年

There's no better teacher than experience. And no better way to learn than to do. I remember a young man competing in his first national and coming 162nd . The following year he was number 2 and the following number 1. See you back next year.

June Julyan

Business Development at BankservAfrica

4 年

Way to go Ryan and Jade

回复

要查看或添加评论,请登录

Ryan Julyan的更多文章

社区洞察

其他会员也浏览了