Snapchat人工智能面试真题

职位分类
全部
数据相关
计算机科学
人工智能
产品经理
BQ
面试题
全部(7)
ML Domain(7)
全部(7)
ML Domain(7)
1.照片分类
2.LeetCode 289
3.最长递增序列
4.最相似朋友
5.最相似图片
6.找长度为K的文件
7.Explain the difference between Random Forest and XGBoost.
1. 照片分类
如何建立model给用上传的照片分类,比如中秋节就分出是不是月饼之类的。要什么data怎么评判要不要launch这个feature。
2. LeetCode 289
According to 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."

The board is made up of an m x n grid of cells, where each cell has an initial state: live (represented by a 1) or dead (represented by a 0). Each cell interacts with its eight neighbors (horizontal, vertical, diagonal) using the following four rules (taken from the above Wikipedia article):

  1. Any live cell with fewer than two live neighbors dies as if caused by under-population.
  2. Any live cell with two or three live neighbors lives on to the next generation.
  3. Any live cell with more than three live neighbors dies, as if by over-population.
  4. Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction.
The next state is created by applying the above rules simultaneously to every cell in the current state, where births and deaths occur simultaneously. Given the current state of the m x n grid board, return the next state.

 

Example 1:

Input: board = [[0,1,0],[0,0,1],[1,1,1],[0,0,0]]
Output: [[0,0,0],[1,0,1],[0,1,1],[0,1,0]]

Example 2:

Input: board = [[1,1],[1,0]]
Output: [[1,1],[1,1]]

 

Constraints:

  • m == board.length
  • n == board[i].length
  • 1 <= m, n <= 25
  • board[i][j] is 0 or 1.
 

Follow up:

  • Could you solve it in-place? Remember that the board needs to be updated simultaneously: 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 upon the border of the array (i.e., live cells reach the border). How would you address these problems?
3. 最长递增序列
part 1: longest increasing consecutive subsequence
part 2: longest increasing subsequence, need to output the list of the subsequence elements, O(n^2) time complexity,0(1) extra space complexity
4. 最相似朋友
Given a seed set which is a set of users (100k - 1M) and user profiles (user features) of all the users (500M). output the list of ‘similar' users to the seed set, output should be around 30Mfrom 500M users
5. 最相似图片
Suppose you have a set of images, try to find the similar images with a target image. You can define the metrics by yourself