您的位置:首页 > 职场人生

一个google面试的准备清单

2015-09-02 21:27 483 查看
  
Data Structures

   1. Integer

     – find number of 1s

     – next largest smaller

     – smallest larger number

     – determine if is palindrom

     – itoa, atoi

     – add 2 numbers w/o using + or arithmetic operators

     – implement *, -, / using only +

     – find max of two numbers w/o comparison

     – swap two numbers with +/-

     – swap two numbers with ^

     – given an integer, find the closest number that ispalindrome

     – implement putlong() by putchar()

   2. Bit array

   3. Linked list

     – find cycle,

     – find position of cycle starts

     – reverse LL

     – delete a node in middle

     – each node contains a value pointer pointing to anode, 

       duplicate LL.

     – remove duplicates from sorted/un-sorted LL.

     – find n-th to last node to end

     – number is represented by LL, add 2 numbers

   4. Array

     – Longest common substring (LCSubstr)

     – Longest common subsequence (LCS).

     – Longest increasing subsequence (LIS).

     – Longest palingdrome in string.

     – array, elements are +/-, find subsequence of max sum

     – circular array, elements are +/-, find subsequence of maxsum

     – find all pairs of integers add up to a sum

     – find all pairs of integers add up to asum, 

       integers are +/- and sorted

     – find one missing number in N numbers in range [0, N]

     – find two missing number in N numbers in range [0, N].

     – binary search circular array

     – Given {a1, a2, a3, ..}, {b1, b2, b3, …}, 

       get {a1, b1, a2, b2, …}

     – Given 2 arrays A and B, A large enough to holdboth, 

       merge B into A.

   5. String

     – KMP, Rabin-Karp, Boyer Moore

     – reverse string

     – reverse words in string  

     – strcpy, strcmp, strstr, atoi, itoa, strdup

     – remove duplicate characters in O(1) space

     – Given dictionary, transform one word to another of samelength.

     – Given large text, find min cover distance of n words.

     – find longest word made of other words

     
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  面试 经验分享