Airbnb Summary


airbnb面试题汇总
Palindrome Pairs

https://www.1point3acres.com/bbs/thread-427067-1-1.html
昂塞也比较标准,我要求直接在西雅图面就不去总部了,一共无论,两轮coding,都是面经题,一轮系统设计:翻译系统,我一会儿仔细讲下,两轮cross functional就是各种behavior问题
1. coding按照面经准备就好,我不确定要求是不是要bug-free但是我都是一边过的,大概20分钟写完所有然后纯聊天20分钟。有个小插曲,第二轮coding我给了个非标准答案用了treemap偷懒,结果面完所有之后被要求加面一轮电面因为给的答案用的datastructure太高级,面试官不确定考察到没到基础能力,也不想挂我,结果加面一轮,也是面经题,加面做完跟我说我是他见过做的最快的(有答案在旁边能不快么OTL)。所以整体感觉因为有面经所以很好过,尽量讲清楚思路就好,就算遇到给的答案不同,讲清楚了对方也很讲道理不会直接挂掉。
2. cross-functional: 基本就是聊天,尽量准备一些非专业的故事,中心思想就是喜欢旅游,喜欢不同文化,觉得气床是可以分享不同文化的平台这类东西。。
3.系统设计翻译系统,我看了所有气床的面经包括他公司blog上关于翻译系统的设计,感觉都没讲很清楚,所以虽然准备了但是感觉还是有点迷糊,当然我也没在气床工作过不具体了解他们的翻译系统,只是刚好我曾经做过app的localization(就是翻译各种语言给app store这样不同国家的人下载的版本就是那个语言的版本),所以面试的时候我是结合自己工作经验做的介绍,以及一些如何做网站翻译的扩展设计(气床的产品主要还是网站,当然现在也有手机端app,手机端的方法跟我做过的应该是一样的),以下只是我个人的理解,大部分也得到面试官的认可所以应该比较接近他们的系统。面试之后还跟他聊了一些他们翻译系统平时的用法和我给的方法的差别(下面会说

https://github.com/gabhi/leetcode-1/blob/master/b/CSVFromList.java
public static String listToCSV (List<List<String>> data) {
  if(data == null || data.size() == 0) return "";

  StringBuilder sb = new StringBuilder();
  for(int i = 0; i < data.size(); i++) {
    List<String> row = data.get(0);
    if(row == null || row.size() == 0) continue;

    if(i != 0) sb.append("\n");
    sb.append(row.get(0));
    for(int j = 0; j < row.size(); j++) {
      sb.append("|");
      sb.append(row.get(j));
    }
  }
           
  return sb.toString();
}

public static void main(String[] args) {
  ArrayList<List<String>> data = new ArrayList<List<String>>();
  data.add(Arrays.asList("John", "Smith", "johnsmith@gmail.com", "Los Angelas, CA"));
  data.add(Arrays.asList("Jane", "Roberts", "janer@msn.com", "San Francisco, CA", "0"));

  String res = listToCSV(data);
  System.out.println(res);
}
https://github.com/gabhi/leetcode-1/blob/master/b/CSVFromString.java
csv parser
如果有逗号,转化成|
如果有引号,把不考虑引号里逗号,把引号里的内容去引号整体打印。
如果有两重引号,只去掉一重引号。
例子
aa, bb, “aa”,”aa,bb”, “aa””aa”””
输出
aa|bb|aa|aa,bb|aa”aa”
*/
 // Parse an escaped string into csv format.
// aa, bb, "aa","aa,aa,bb,cc", "aa"aa""
// 输出
// aa|bb|aa|aa,bb,cc|aa”aa”
 
  public static String stringToCSV (String str) {
    if(str == null || str.length() == 0) return "";
    StringBuilder sb = new StringBuilder();
    int i = 0, j = 0, quotes = 0;

    while(j < str.length()) {
      char c = str.charAt(j);
      if(c == '"') quotes++;
      if(c == ',' && quotes % 2 == 0) {
        sb.append(trimQuotes(str, i, j));
        sb.append("|");
        i = j + 1;
        quotes = 0;
      }
      j++;
    }
    sb.append(trimQuotes(str, i, j));
    return sb.toString();
  }

  private static String trimQuotes(String str, int i, int j) {
    String sub = str.substring(i, j).trim();
    if(sub.charAt(0) == '\"') {
      sub = sub.substring(1, sub.length() - 1);
    }
    sub = sub.replace("\"\"", "\"");
    return sub;
  }


  public static void main(String[] args) {
    String input = "aa, bb, \"aa\",\"aa,bb\", \"aa\"\"aa\"\"\"";
    String res = stringToCSV(input);
    System.out.println(res);
  }



Labels

LeetCode (1432) GeeksforGeeks (1122) LeetCode - Review (1067) Review (882) Algorithm (668) to-do (609) Classic Algorithm (270) Google Interview (237) Classic Interview (222) Dynamic Programming (220) DP (186) Bit Algorithms (145) POJ (141) Math (137) Tree (132) LeetCode - Phone (129) EPI (122) Cracking Coding Interview (119) DFS (115) Difficult Algorithm (115) Lintcode (115) Different Solutions (110) Smart Algorithm (104) Binary Search (96) BFS (91) HackerRank (90) Binary Tree (86) Hard (79) Two Pointers (78) Stack (76) Company-Facebook (75) BST (72) Graph Algorithm (72) Time Complexity (69) Greedy Algorithm (68) Interval (63) Company - Google (62) Geometry Algorithm (61) Interview Corner (61) LeetCode - Extended (61) Union-Find (60) Trie (58) Advanced Data Structure (56) List (56) Priority Queue (53) Codility (52) ComProGuide (50) LeetCode Hard (50) Matrix (50) Bisection (48) Segment Tree (48) Sliding Window (48) USACO (46) Space Optimization (45) Company-Airbnb (41) Greedy (41) Mathematical Algorithm (41) Tree - Post-Order (41) ACM-ICPC (40) Algorithm Interview (40) Data Structure Design (40) Graph (40) Backtracking (39) Data Structure (39) Jobdu (39) Random (39) Codeforces (38) Knapsack (38) LeetCode - DP (38) Recursive Algorithm (38) String Algorithm (38) TopCoder (38) Sort (37) Introduction to Algorithms (36) Pre-Sort (36) Beauty of Programming (35) Must Known (34) Binary Search Tree (33) Follow Up (33) prismoskills (33) Palindrome (32) Permutation (31) Array (30) Google Code Jam (30) HDU (30) Array O(N) (29) Logic Thinking (29) Monotonic Stack (29) Puzzles (29) Code - Detail (27) Company-Zenefits (27) Microsoft 100 - July (27) Queue (27) Binary Indexed Trees (26) TreeMap (26) to-do-must (26) 1point3acres (25) GeeksQuiz (25) Merge Sort (25) Reverse Thinking (25) hihocoder (25) Company - LinkedIn (24) Hash (24) High Frequency (24) Summary (24) Divide and Conquer (23) Proof (23) Game Theory (22) Topological Sort (22) Lintcode - Review (21) Tree - Modification (21) Algorithm Game (20) CareerCup (20) Company - Twitter (20) DFS + Review (20) DP - Relation (20) Brain Teaser (19) DP - Tree (19) Left and Right Array (19) O(N) (19) Sweep Line (19) UVA (19) DP - Bit Masking (18) LeetCode - Thinking (18) KMP (17) LeetCode - TODO (17) Probabilities (17) Simulation (17) String Search (17) Codercareer (16) Company-Uber (16) Iterator (16) Number (16) O(1) Space (16) Shortest Path (16) itint5 (16) DFS+Cache (15) Dijkstra (15) Euclidean GCD (15) Heap (15) LeetCode - Hard (15) Majority (15) Number Theory (15) Rolling Hash (15) Tree Traversal (15) Brute Force (14) Bucket Sort (14) DP - Knapsack (14) DP - Probability (14) Difficult (14) Fast Power Algorithm (14) Pattern (14) Prefix Sum (14) TreeSet (14) Algorithm Videos (13) Amazon Interview (13) Basic Algorithm (13) Codechef (13) Combination (13) Computational Geometry (13) DP - Digit (13) LCA (13) LeetCode - DFS (13) Linked List (13) Long Increasing Sequence(LIS) (13) Math-Divisible (13) Reservoir Sampling (13) mitbbs (13) Algorithm - How To (12) Company - Microsoft (12) DP - Interval (12) DP - Multiple Relation (12) DP - Relation Optimization (12) LeetCode - Classic (12) Level Order Traversal (12) Prime (12) Pruning (12) Reconstruct Tree (12) Thinking (12) X Sum (12) AOJ (11) Bit Mask (11) Company-Snapchat (11) DP - Space Optimization (11) Dequeue (11) Graph DFS (11) MinMax (11) Miscs (11) Princeton (11) Quick Sort (11) Stack - Tree (11) 尺取法 (11) 挑战程序设计竞赛 (11) Coin Change (10) DFS+Backtracking (10) Facebook Hacker Cup (10) Fast Slow Pointers (10) HackerRank Easy (10) Interval Tree (10) Limited Range (10) Matrix - Traverse (10) Monotone Queue (10) SPOJ (10) Starting Point (10) States (10) Stock (10) Theory (10) Tutorialhorizon (10) Kadane - Extended (9) Mathblog (9) Max-Min Flow (9) Maze (9) Median (9) O(32N) (9) Quick Select (9) Stack Overflow (9) System Design (9) Tree - Conversion (9) Use XOR (9) Book Notes (8) Company-Amazon (8) DFS+BFS (8) DP - States (8) Expression (8) Longest Common Subsequence(LCS) (8) One Pass (8) Quadtrees (8) Traversal Once (8) Trie - Suffix (8) 穷竭搜索 (8) Algorithm Problem List (7) All Sub (7) Catalan Number (7) Cycle (7) DP - Cases (7) Facebook Interview (7) Fibonacci Numbers (7) Flood fill (7) Game Nim (7) Graph BFS (7) HackerRank Difficult (7) Hackerearth (7) Inversion (7) Kadane’s Algorithm (7) Manacher (7) Morris Traversal (7) Multiple Data Structures (7) Normalized Key (7) O(XN) (7) Radix Sort (7) Recursion (7) Sampling (7) Suffix Array (7) Tech-Queries (7) Tree - Serialization (7) Tree DP (7) Trie - Bit (7) 蓝桥杯 (7) Algorithm - Brain Teaser (6) BFS - Priority Queue (6) BFS - Unusual (6) Classic Data Structure Impl (6) DP - 2D (6) DP - Monotone Queue (6) DP - Unusual (6) DP-Space Optimization (6) Dutch Flag (6) How To (6) Interviewstreet (6) Knapsack - MultiplePack (6) Local MinMax (6) MST (6) Minimum Spanning Tree (6) Number - Reach (6) Parentheses (6) Pre-Sum (6) Probability (6) Programming Pearls (6) Rabin-Karp (6) Reverse (6) Scan from right (6) Schedule (6) Stream (6) Subset Sum (6) TSP (6) Xpost (6) n00tc0d3r (6) reddit (6) AI (5) Abbreviation (5) Anagram (5) Art Of Programming-July (5) Assumption (5) Bellman Ford (5) Big Data (5) Code - Solid (5) Code Kata (5) Codility-lessons (5) Coding (5) Company - WMware (5) Convex Hull (5) Crazyforcode (5) DFS - Multiple (5) DFS+DP (5) DP - Multi-Dimension (5) DP-Multiple Relation (5) Eulerian Cycle (5) Graph - Unusual (5) Graph Cycle (5) Hash Strategy (5) Immutability (5) Java (5) LogN (5) Manhattan Distance (5) Matrix Chain Multiplication (5) N Queens (5) Pre-Sort: Index (5) Quick Partition (5) Quora (5) Randomized Algorithms (5) Resources (5) Robot (5) SPFA(Shortest Path Faster Algorithm) (5) Shuffle (5) Sieve of Eratosthenes (5) Strongly Connected Components (5) Subarray Sum (5) Sudoku (5) Suffix Tree (5) Swap (5) Threaded (5) Tree - Creation (5) Warshall Floyd (5) Word Search (5) jiuzhang (5)

Popular Posts