In this homework, you will watch a real mock Google engineering interview, pause before the solution, try the problem yourself, and then compare your approach with the engineers' discussion.
You will:
- observe how engineers communicate during a coding interview
- pause and solve the interview question yourself before watching the solution
- write down your thought process clearly
- provide Python code for your solution
- compare your approach with the video discussion
Take your time and think. The goal is not to rush to the answer. The goal is to practice how you reason, explain trade-offs, and improve your solution after feedback.
Watch:
How to: Work at Google — Example Coding/Engineering Interview
Google engineers demonstrate a mock interview question. After they code, they highlight best practices for interviewing at Google.
Although the solution in the video is written in C++, the thought process is the same. You should try to implement your own solution in Python.
This homework is high difficulty. Do not worry if it takes time. Pause the video, think carefully, try examples by hand, and build your solution step by step.
- Start watching the video.
- When the interviewer gives the coding problem and before the engineers complete the solution, pause the video.
- Try to solve the problem yourself in Python.
- Take notes while you work:
- What did you understand the problem to be?
- What examples or edge cases did you test mentally?
- What was your first idea?
- Did you improve or change your approach?
- What is the time and space complexity of your solution?
- Resume the video and watch how the engineers solve it.
- Compare your solution with theirs.
- Write a short reflection on what you would do differently in an interview next time.
Create this file:
session4/solutions/exercise-04-homework.mdYour markdown file should include:
# Session 4 Homework
## Video
Link: https://www.youtube.com/watch?v=XKu_SEDAykw
## My understanding of the problem
Write the problem in your own words.
## My thought process
Explain how you approached the problem.
## My Python solution
```python
# Paste your Python code here
```
## Complexity
- Time complexity:
- Space complexity:
## Comparison with the video solution
What was similar?
What was different?
What did you learn?
## Interview reflection
What would you do better next time when explaining your thinking?- Use Python.
- Do not copy the solution before trying it yourself.
- Pause first, solve first, then continue watching.
- It is okay if your first solution is not perfect.
- Write enough explanation that another student can follow your thinking.
Post your completed session4/solutions/exercise-04-homework.md in the class discussion forum.
Use the MS Teams discussion forum:
When you post, include:
- your markdown solution
- your Python code
- one thing you learned about interviewing