Thanks for spending time taking the tech interview. It is an opportunity to show how awesome you are at programming.
Usually, we have 3 - 4 rounds of interviews:
- Preliminary tech interview (this round, Skype/phone)
- Advanced tech interview (1 - 2 rounds, Skype/phone)
- Interview with the team (on-site)
In most cases, it takes 2 - 3 weeks to complete the process.
Questions in the preliminary test stem from online judge system platform like LeetCode,or international programming contest like ACM.
- Keep your code neat, concise, and readable.
- Use any programming language of your choice.
- Commit your code to Github, and send the repository URL back.
- Unit test(s) is REQUIRED for every question.
- You only have one hour! Don't worry, most well-trained developers could do this.
In this programming test, you should demonstrate:
- Good understanding of the programming language you use.
- Good programming practices. Code quality and maintainability.
- Good understanding of unit tests.
- Good understanding of algorithms.
Should you have any questions, shoot us an email.
We highly encourage you to do so, even if you need further assistance to overcome these programming hurdles. Apart from examining your programming skills, we also want to see what it looks like to work with you.
Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i].
Solve it without division and in O(n).
For example, given [1,2,3,4], return [24,12,8,6].
Given an array nums, write a function to move all non-zero numbers to the head of it while maintaining the relative order of the non-zero numbers.
For example, given nums = [0, 1, 0, 3, 12], after calling your function, nums should be [1, 3, 12, 0, 0].
Note: You must do this in-place without making a copy of the array. Minimize the total number of operations.
According to the Wikipedia's article: "The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway in 1970."
Given a board with m by n cells, each cell has an initial state live (1) or dead (0). Each cell interacts with its eight neighbors (horizontal, vertical, diagonal) using the following four rules (taken from the above Wikipedia article):
- Any live cell with fewer than two live neighbors dies, as if caused by under-population.
- Any live cell with two or three live neighbors lives on to the next generation.
- Any live cell with more than three live neighbors dies, as if by over-population..
- Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction. Write a function to compute the next state (after one update) of the board given its current state.
Follow up:
- Could you solve it in-place? Remember that the board needs to be updated at the same time: You cannot update some cells first and then use their updated values to update other cells.
- In this question, we represent the board using a 2D array. In principle, the board is infinite, which would cause problems when the active area encroaches the border of the array. How would you address these problems?
Implement int sqrt(int x).
Compute and return the square root of x.
Implement pow(x, n).