Page 154 - Career Development Guidebook
P. 154
4.
.
SECTION 4: INTERVIEWS
5. .
6. .
7. .
8. There are two sorted arrays, with and elements, respectively. Find the median of the two sorted
arrays. The solution should have a runtime.
9. Write a program to solve a Sudoku puzzle by filling in the empty cells. The board is of the same size.
It contains only 1–9 numbers. Empty cells are denoted by *. Each board has one unique solution.
10. Given a memory block represented by an empty array, write a program to manage the dynamic
allocation of that memory block. The program should support two methods: malloc() to allocate
memory and free() to free a memory block.
11. Given a string of mathematical expressions, such as 10 * 4 + (4 + 3) / (2 + 1), calculate it. It should
support the four operators +, -, :, /, and the brackets ().
12. Given a directory path, descend into that directory and find all the files with duplicate content.
13. In Google Docs, you have the Justify alignment option that spaces your text to align with both left
and right margins. Write a function to print out a given text line-by-line (except the last line) in
Justify alignment format. The length of a line should be configurable.
14. You have 1 million text files, each of which is a news article scraped from various news sites. Since
news sites often report the same news, even the same articles, many of the files have content very
similar to each other. Write a program to filter out these files so that the end result contains only
files that are sufficiently different from each other in the language of your choice. You’re free to
choose a metric to define the “similarity” of content between files.
Complexity and numerical analysis
1. Matrix multiplication
a. [E] You have three matrices, and you need to calculate the product. In what order would you
perform your multiplication, and why?
b. [M] Now you need to calculate the product of matrices. How would you determine the order in
which to perform the multiplication?
2. [E] What are some of the causes of numerical instability in deep learning?
3. [E] In many machine learning techniques (e.g., batch norm), we often see a small term added to the
calculation. What’s the purpose of that term?
4. [E] What made GPUs popular for deep learning? How are they compared to TPUs?
5. [M] What does it mean when we say a problem is intractable?
6. [H] What is the time and space complexity for doing backpropagation on a recurrent neural
network?
7. [H] Is knowing a model’s architecture and its hyperparameters enough to calculate the memory
requirements for that model?
8. [H] Your model works fine on a single GPU but gives poor results when you train it on 8 GPUs. What
might be the cause of this? What would you do to address it?
9. [H] What benefits do we get from reducing the precision of our model? What problems might we
run into? How do we solve these problems?
10. [H] How to calculate the average of 1 million floating-point numbers with minimal loss of precision?
11. [H] How should we implement batch normalization if a batch is spread out over multiple GPUs?
12. [M] Given the following code snippet: What might be a problem with it? How would you improve it?
Hint: This is an actual question asked on StackOverflow.
154