Coding interviews

jackfr@google.com

jack

Senior Software Eng @ Google

 

Uni of Bath 2014 graduate :)

jack

Interviewed & joined Google in Feb 2020

~50 interviews at Google since joining

 

understanding a tech interview

an example question

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.

Flame charts

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.

Flame charts

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
 */

three parts to implementation

data structure

How are you going to represent the core concepts in your interview?

implementation

Once you have a data structure in mind, you then need to implement it.

iterate

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.

 

CodeSandbox link

Let's DO it!

demonstrating your ability

programming

You need to demonstrate you have the programming ability to convert an idea into an implementation.

approach

Show that you consider different approaches and can determine the trade-offs of each option.

communication

Show that you are a good communicator and can clearly describe an approach and technical plan to someone.

1

Take a minute to think through the problem

2

Describe your early thoughts and initial high level ideas

3

Plan out your potential approaches and list the pros and cons.

5

Implement your preferred approach carefully and in a structured way.

4

Ask the interviewer any clarifying questions about the problem.

6

Run through your solution, checking for bugs or any mistakes.

Minimal

By Jack Franklin