jackfr@google.com
Senior Software Eng @ Google
Uni of Bath 2014 graduate :)
Interviewed & joined Google in Feb 2020
~50 interviews at Google since joining
Let's collaboratively work on an interview question.
You are working on an application that shows the user how their website performs by rendering flame charts. A flame chart is a graph that shows how long functions took to run on a page and is used to debug performance.
Implement a function that can create a flame chart from data. The exact implementation and data structures used is entirely up to you.
You are working on an application that shows the user how their website performs by rendering flame charts. A flame chart is a graph that shows how long functions took to run on a page and is used to debug performance.
Implement a function that can create a flame chart from data. The exact implementation and data structures used is entirely up to you.
DON'T PANIC!
You are working on an application that shows the user how their website performs by rendering flame charts. A flame chart is a graph that shows how long functions took to run on a page and is used to debug performance.
Implement a function that can create a flame chart from data. The exact implementation and data structures used is entirely up to you.
Clarify the situation
Please could I have an example of a flame chart to help me understand?
/**
* An example flamechart. Here the X axis is time taken.
*
* [======== one ========]
* [= two ====] [= four ]
* [= three =]
* [= five =]
* [= six =]
*
* This tells us that:
* - function one() was the longest running function
* - function one() called two functions: two and four
* - function two() called three(),
* - - - which called five()
* - - - - which called six()
* - function four() did not call any functions
*/
How are you going to represent the core concepts in your interview?
Once you have a data structure in mind, you then need to implement it.
Reflect on your approach and refine. The interviewer may ask follow-up questions at this point.
Let's talk through this together as if we were being interviewed.
Note: I am using JavaScript, but this will look very familiar to you and your choice of language normally does not matter.
You need to demonstrate you have the programming ability to convert an idea into an implementation.
Show that you consider different approaches and can determine the trade-offs of each option.
Show that you are a good communicator and can clearly describe an approach and technical plan to someone.
Take a minute to think through the problem
Describe your early thoughts and initial high level ideas
Plan out your potential approaches and list the pros and cons.
Implement your preferred approach carefully and in a structured way.
Ask the interviewer any clarifying questions about the problem.
Run through your solution, checking for bugs or any mistakes.