Skip to content

Commit

Permalink
1206
Browse files Browse the repository at this point in the history
  • Loading branch information
youhusky committed Dec 6, 2017
1 parent f2e77d4 commit 7408c19
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 0 deletions.
16 changes: 16 additions & 0 deletions 632.SmallestRange.py → 632. SmallestRange.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# You have k lists of sorted integers in ascending order. Find the smallest range that includes at least one number from each of the k lists.

# We define the range [a,b] is smaller than range [c,d] if b-a < d-c or a < c if b-a == d-c.

# Example 1:
# Input:[[4,10,15,24,26], [0,9,12,20], [5,18,22,30]]
# Output: [20,24]
# Explanation:
# List 1: [4, 10, 15, 24,26], 24 is in range [20,24].
# List 2: [0, 9, 12, 20], 20 is in range [20,24].
# List 3: [5, 18, 22, 30], 22 is in range [20,24].
# Note:
# The given list may contain duplicates, so ascending order means >= here.
# 1 <= k <= 3500
# -105 <= value of elements <= 105.
# For Java users, please note that the input type has been changed to List<List<Integer>>. And after you reset the code template, you'll see this point.
import heapq
class Solution(object):
def smallestRange(self, nums):
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,14 @@
[x] Sort the numbers based on categories -- 075 follow up
[x] Binary Search templete

## System Design
[] Tushar Roy

## New

[] https://github.com/shileiwill/destination/blob/5b2b59eb070dd13232fe0e467d64655e36874b3f/Round1/src/company/facebook/WinDesign

[] https://github.com/tongzhang1994/Facebook-Interview-Coding/blob/master/Least%20Removal%20to%20Valid%20Palindromic%20Subsequence.java

[] https://yuelng.github.io/2015/11/13/note/note_system_design_question/

52 changes: 52 additions & 0 deletions 更新面经.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
https://github.com/shileiwill/destination/blob/5b2b59eb070dd13232fe0e467d64655e36874b3f/Round1/src/company/facebook/WinDesign

https://github.com/tongzhang1994/Facebook-Interview-Coding/blob/master/Least%20Removal%20to%20Valid%20Palindromic%20Subsequence.java

第一轮 Coding
input是一个array,要求生成一个树,有以下三个属性
1)二叉树
2)Min Heap,表示node的每个子节点的值都大于或者等于这个node的值
3)做inorder traversal的时候要保持array的顺序
. from: 1point3acres.com/bbs
举个例子input是 5, 2, 10, 7
2
/ \
5 10
\
7

follow up 是一个addNode的函数,输入是root node,还有个int value,保持原有的属性,返回root

第二轮 System Design
Design Facebook Search System.
要求实现friends search和post search. visit 1point3acres.com for more.

post search我说可以用inverted index,但是friends search就没有思路了。
然后厚着脸皮说没有相关经验,然后就扯到search的web service还有typeahead ui怎么实现了

第三轮 Coding
面试官找不到房间,迟到了一会,就做了一到题目Insert Interval,但也是写的磕磕盼盼的. visit 1point3acres.com for more.

第四轮 Career

问了一个dot product问题,怎么存vector,vector特别大该怎么处理等等

!!第五轮 System Design
Design Instagram. visit 1point3acres.com for more.
主要扯了一下feed的pull vs push两种方法,还问了photo storage该怎么整,又是不会。。。

http://www.1point3acres.com/bbs/forum.php?mod=viewthread&tid=307365&extra=page%3D1%26filter%3Dsortid%26sortid%3D311%26searchoption%5B3090%5D%5Bvalue%5D%3D1%26searchoption%5B3090%5D%5Btype%5D%3Dradio%26searchoption%5B3046%5D%5Bvalue%5D%3D2%26searchoption%5B3046%5D%5Btype%5D%3Dradio%26sortid%3D311


刚面完。
店面是next permutation。.

1. bahavior, 最后15分钟出了个题,. From 1point 3acres bbs
几个user, 每个user 在下面的时间段发了信息,找一个最短的时间窗使得每个user都发了至少一条信息。应该是利口原题吧
[[1,3,4,7, 10],
[4, 6, 8 ,10, 20],
[7, 15, 16, 20, 25]
].
2. 给一个无穷大网格,给一个起始和终点,还有一些格子是不能通过的,求起点到终点的最短距离. 涓€浜�-涓夊垎-鍦帮紝鐙鍙戝竷
3. 利口253, 还有task题,是按顺序排列
4. 设计download api

0 comments on commit 7408c19

Please sign in to comment.