一亩三分地论坛

 找回密码
 获取更多干货,去instant注册!

一亩三分地官方iOS手机应用下载
查看: 3633|回复: 8
收起左侧

Amazon Intern 命运多舛奇葩面... 【g附加本人手机的面经汇总】

[复制链接] |试试Instant~ |关注本帖
兔流感阿义 发表于 2015-2-25 12:12:11 | 显示全部楼层 |阅读模式

2015(1-3月) 码农类 硕士 实习@Amazon - 网上海投 - 技术电面 在线笔试 |Other

注册一亩三分地论坛,查看更多干货!

您需要 登录 才可以下载或查看,没有帐号?获取更多干货,去instant注册!

x
Amazon 2015 summer internship 电面面经

本来约的17号下午,13号(周五)发邮件,没回复

. From 1point 3acres bbs
16号总统日,难道Amazon放假?没回复...

17号早上收到邮件,大致内容是你发送的邮寄没能送达,已经被服务器退回... . from: 1point3acres.com/bbs

给跪啊!!!什么年代了,邮寄无法送达什么意思,今天才告诉我什么意思!!! 鏉ユ簮涓浜.涓夊垎鍦拌鍧.

. 1point3acres.com/bbs没办法下午果然没人理我,于是接着给hr约约约,第二天hr说,不好意思,没约上,您再来吧~
. Waral 鍗氬鏈夋洿澶氭枃绔,
第二次约了23号(周一)下午,很快收到confirm信说下午,没过多久又收到一封confirm信说时间是23号上午...

你逗我,发两封不一样的时间.... visit 1point3acres.com for more.

问hr,他说,那上一次就作废了,按照第二次吧...我擦...好吧,听你的....鐣欏璁哄潧-涓浜-涓夊垎鍦

23号起了一个大早,距离面试还有一个小时,又收到一封邮寄,说今天技术人员忙,要不你再约一个时间..... Waral 鍗氬鏈夋洿澶氭枃绔,

(╯‵□′)╯︵┻━┻ WTF!!!
. 鐗涗汉浜戦泦,涓浜╀笁鍒嗗湴
怎么如此艰难险阻!!!!玩我呢吧?!

得....1point3acres缃

回了个:你说几号就几号,你说几点就几点...

hr沉默了几个小时,回复说,那就明天吧...
.鏈枃鍘熷垱鑷1point3acres璁哄潧
然后就约了今天下午,终于成功的面了....

===========================分割!===========================
说说面经
==========================================================

面试官是一个印度大姐,大姐似乎挺忙的,听到那边狂敲代码,有一句每一句的和我聊天

大姐问了姓名和学校,就开始代码了

1) 第一题问了给一个int[] array, 求最大值
我愣了...啊,干嘛问这个?逗我?不应该啊~
我说扫一遍,max = Math.max(max, arr); 啊
她说:good!请听follow up~
(我去....刚刚是热身,现在来真的)
问:如果是stream, 怎么求最大值?
啊....这不一样吗?还是一个个走,如果大于最大,更新最大值啊...
她说:great!. Waral 鍗氬鏈夋洿澶氭枃绔,
(我去...大姐....你逗我)
她说,那现在来真的了,请听题!
说:如果一个时间段: t0, t1, t2, ... tn 每一段5分钟,一个stream 的int[] array,那么走着走着,突然我说停,给我 ti - tj 这个时间段的最大值,怎么做?
(这是给最大值干上了...)
我说,五分钟一个interval,到了第一个5分钟就把t0 的最大值存起来,第二个五分钟把这五分钟内的最大值存到t1,以此类推
大姐犹豫了片刻,说,没听懂~. 1point 3acres 璁哄潧
(醉了....)
我又解释了解释,大姐说,恩,不错~看来我要出难题了~

2)大姐问了上面的time 和 space,就出了第二题:
说一个node list, 输入(int n , Node head) 求倒数第n个node的val
我说,双指针,第一个先走n步,第二个从头开始走,第一个到头了,第二个指的就是n. 涓浜-涓夊垎-鍦帮紝鐙鍙戝竷
大姐说:好!那你写吧
啪啪啪,写完了~. Waral 鍗氬鏈夋洿澶氭枃绔,
大姐说:你的边界情况都考虑了嘛?
我说:考虑了把(这没啥技术含量)
大姐说:n > length 的情况呢?
我说:考虑了啊,你看
大姐沉吟片刻:哟,确实哎~
. 1point 3acres 璁哄潧
大姐可能没话说了,看了看表,说时间还早,要不你把上一问的那个stream的代码写了吧。. more info on 1point3acres.com
我说好
啪啪啪,写完了~
大姐说,恩,时间差不多了,你有什么问题问我吗?
我说没有,have a nice day~
大姐似乎接不上话了...挂了...



===========================分割!===========================. 鐣欏鐢宠璁哄潧-涓浜╀笁鍒嗗湴
自己整理的之前面Amazon intern的面经分享出来,省的大家去一页一页找了,加分~攒人品~. 1point 3acres 璁哄潧
==========================================================. 鐗涗汉浜戦泦,涓浜╀笁鍒嗗湴
包含两部分:
1)问答,可能会问的知识题,比如什么事hashtable, interface 和abstract class区别. 1point3acres.com/bbs
2)算法. 1point3acres.com/bbs

问答
The difference between Linked List and Array List
get(index) and add() is O(1) for ArrayList;
Iterator.remove(), ListIterator.add(E element), add() is O(1) for Linked List
. more info on 1point3acres.com

BFS DFS 时间空间复杂度. more info on 1point3acres.com
DFS: K - # of children each node has; H - height(depth)
Time O(K^H): exponential over the depth K
    1 + K + K^2 + … + K^(H-1). 1point 3acres 璁哄潧
    Geometric Progression(等比数列) a1(1 - q^n)/(1 - q)
    1(1 - K^H)/(1 - K) so the Big O is O(K^H). 涓浜-涓夊垎-鍦帮紝鐙鍙戝竷
Space: O(K)

BFS: Same thing. Vertical traverse to horizontal traverse
-google 1point3acres
For a graph G(V, E) :|V| - # of vertices; |E| - # of edges
BFS & DFS:
    Time O(|V| + |E|);
    Space O(|V|);

What data structure do you use when designing a phone contact book?
Trie Tree:
http://www.codeproject.com/Articles/18033/Phone-Directory-Implementation-Using-TRIE


HashMap vs TreeMap and it’s big O
TreeMap’s key have to be comparable(implement comparable interface) or give a comparator object to constructor will constructing this TreeMap.
It’s Insertion, Deletion and Search is O(log n). Because TreeMap is implemented with a red-black tree. Where n is the number of entries in the hash map.
鏉ユ簮涓浜.涓夊垎鍦拌鍧.
Abstract class vs Interface


Java Garbage Collection
http://www.oracle.com/webfolder/technetwork/tutorials/obe/java/gc01/index.html

. visit 1point3acres.com for more.
Heap. Insertion Deletion


What is HashMap.
Hash function
When to use Hashtable
How HashMap deal with collision.. 1point 3acres 璁哄潧

. 1point3acres.com/bbs
Merge Sort. 涓浜-涓夊垎-鍦帮紝鐙鍙戝竷


Quick Sort-google 1point3acres


. Waral 鍗氬鏈夋洿澶氭枃绔,


. 鐣欏鐢宠璁哄潧-涓浜╀笁鍒嗗湴
. from: 1point3acres.com/bbs

算法题
2 Sum 3 Sum

input a random number from 1-100. Output a random number from 1-30;


An array range from 1 to 10000. In a 1000 length array. Determine if their is a duplication
Follow up: if the array’s length is 10billion. (Must be a duplicate)
O(n) time O(n) space
1) HashMap
2) BitSet, at most put 1000, if more, will contain.
3) Bucket Sort idea. Use 1000 buckets, put numbers in each one and exam the buckets
O(1) space
LC first miss positive’s idea:
https://oj.leetcode.com/problems/first-missing-positive/
. From 1point 3acres bbs

Two linked list node, where to merge. more info on 1point3acres.com
Follow up: k linked lists, find common nodes of all k lists(could be 0, could be n, n is size of longest list)


Leetcode Maximum Subarray



Count words in a string.


Print tree level by level(BFS). more info on 1point3acres.com
1) Implement with only one queue

. Waral 鍗氬鏈夋洿澶氭枃绔,
Tree serialization and de-serialization


Find and return the top k values of an unsorted int array
1) Size k max heap
2) Quick Select


Find min and max of an array with only 3n/2 comparison


LC, Same Tree
1) Recursion
2) Iteration

.鐣欏璁哄潧-涓浜-涓夊垎鍦
Palindrome of a string(determine if a string is palindrome)


DFS pre post in order traversal.


BFS traversal Print path

. 鍥磋鎴戜滑@1point 3 acres
Binary Search Tree(search in a BST)


Print values in order in a BST

. 鍥磋鎴戜滑@1point 3 acres
Reverse String(String is stored as a char[] array)


LC: Single Number I II
. 鐣欏鐢宠璁哄潧-涓浜╀笁鍒嗗湴

Find most frequent word in a string


Find the most right node in a binary tree and return it’s val it’s depth. From 1point 3acres bbs


Given an int[] array, int n. Find all sub arrays with size n. Find the avg of this those subarrays. Return the avg number that appears most frequently. And it’s frequency.


Find diagonal sum, row sum, column sum of a matrix. Return the largest sum.. 1point3acres.com/bbs

. more info on 1point3acres.com

LC: Cross point of two linked list, return that point.. 1point3acres.com/bbs
.鏈枃鍘熷垱鑷1point3acres璁哄潧

cows and bulls  2个string 相同地方相同字母是 cow  相同字母不相同的地方时bulls return cow和bull各几个 hashtable 这次再不会栽给你了
. From 1point 3acres bbs


LC: Single Number I & II. 鍥磋鎴戜滑@1point 3 acres
Find an unique number in an array. . from: 1point3acres.com/bbs
0) Brute force. O(n^2)
1) HashTable
2) Sort and two pointers
3) Two pointers
http://www.careercup.com/question?id=7902674



Given n points, find k points that nearest to origin(0,0). From 1point 3acres bbs
1) Calculate them all, Sort, find the first k
2) Max-heap. with size of k (Careful with max and min).鐣欏璁哄潧-涓浜-涓夊垎鍦

. 鐗涗汉浜戦泦,涓浜╀笁鍒嗗湴
String to Binary. visit 1point3acres.com for more.
import java.util.*;public class Solution {    public static void main(String[] args) {        Solution sol = new Solution();        String s = "afoo";        byte[] bArr = s.getBytes();        StringBuilder sb = new StringBuilder();        for (byte b : bArr) {            int temp = b;            for (int i = 0; i < 8; i++) {                sb.append(((temp & 128) == 0) ? 0 : 1);                temp = temp << 1;            }            sb.append(" ");        }        System.out.println(sb);    }}


Merge sort


LC: Min Stack
https://oj.leetcode.com/problems/min-stack/
. from: 1point3acres.com/bbs


Reverse Linked List
.鐣欏璁哄潧-涓浜-涓夊垎鍦
. more info on 1point3acres.com
LC: Path Sum of a tree.. 鐣欏鐢宠璁哄潧-涓浜╀笁鍒嗗湴


Get all duplicates from an array
.鐣欏璁哄潧-涓浜-涓夊垎鍦

Implement stack, pop, push, getMaximal()
. 1point 3acres 璁哄潧

Find how many 1’s in the binary of an integer.
import java.util.*;public class Solution {    public static void main(String[] args) {        Solution sol = new Solution();        StringBuilder sb = new StringBuilder();        int temp = Integer.MIN_VALUE;        int count = (temp > 0) ? 0 : 1;        int l = 2 << 30;        for (int i = 0; i < 32; i++) {            if ((temp & l) != 0) {                count++;            }            temp <<= 1;        }        System.out.println(count);    }}

int -1 :
    111…1 total 32 1s
int Integer.MIN_VALUE :
    100…0 first 1 means negative, followed by 31 0
-1 - 1 = -1 + -1 = 1111 + 1111 = -1 x 2 = -1 << 1 = 1110

Find a prime numbers between int m and int n
.鏈枃鍘熷垱鑷1point3acres璁哄潧

.鏈枃鍘熷垱鑷1point3acres璁哄潧
Find intersection of two array (ArrayList, LinkedList)


String permutation. Given a String s, Return List<String> of all permutations


Detect a loop in a binary tree
Follow up.如果已知90%i情况下loop存在与前10 level of the tree.如何optimize

. 鐗涗汉浜戦泦,涓浜╀笁鍒嗗湴
Given String s1 and String s2, determine if s2 can be used to construct s1
(Find if s2’s char set is a subset of s1’s char set)


Sorted LinkedList, find loop in it. from: 1point3acres.com/bbs
(If (next.val < cur.val) return true;). Waral 鍗氬鏈夋洿澶氭枃绔,


Best time to buy and sell stock


Check if one string is rotated string of another. 1point3acres.com/bbs

.鐣欏璁哄潧-涓浜-涓夊垎鍦
gray code
-google 1point3acres

find nth Fibonacci number.鏈枃鍘熷垱鑷1point3acres璁哄潧


An array of number with length 500 million. All numbers are 10 bit. Sort it. 涓浜-涓夊垎-鍦帮紝鐙鍙戝竷
1) Bucket sort
2) Counting sort
3) Radix sort
-google 1point3acres

Delete repeat nodes in a linked list


Min Max Stack


LC: Minimum Window Substring(sub int[] array)


compare version number

. 鍥磋鎴戜滑@1point 3 acres
valid palindrome
.鐣欏璁哄潧-涓浜-涓夊垎鍦

Given any two nodes in a binary tree. Find a path that across least nodes 鏉ユ簮涓浜.涓夊垎鍦拌鍧.
1) LCA(Least Common Ancestor)
. Waral 鍗氬鏈夋洿澶氭枃绔,

Write a function that will take in email lists and return a new email list that contains only the email addresses that existed in all lists// 1: foo@amazon.com, bar@amazon.com
// 2: bar@amazon.com, bar@amazon.com

// o: bar@amazon.com
rolling HashSet-google 1point3acres
or one set . Waral 鍗氬鏈夋洿澶氭枃绔,

.1point3acres缃
. From 1point 3acres bbs



. 1point3acres.com/bbs







. 1point3acres.com/bbs
鏉ユ簮涓浜.涓夊垎鍦拌鍧.


评分

9

查看全部评分

本帖被以下淘专辑推荐:

LuckyGemini 发表于 2015-2-25 12:32:15 | 显示全部楼层
关注一亩三分地公众号:
Warald_一亩三分地
楼主棒棒哒!!!好希望自己也可以拿到电面QAQ
回复 支持 反对

使用道具 举报

354886 发表于 2015-2-25 12:44:10 | 显示全部楼层
关注一亩三分地微博:
Warald
多谢LZ。祝拿到Offer
回复 支持 反对

使用道具 举报

lemonie 发表于 2015-2-25 13:30:04 | 显示全部楼层
太谢谢啦  祝早拿到offer~
回复 支持 反对

使用道具 举报

Deckardmzr 发表于 2015-2-25 13:34:39 | 显示全部楼层
lz竟然没准备给面试官的问题……不过答的挺好,应该能过了
求职神器indeed - 在全球最大的求职网站找找适合你的工作?
回复 支持 反对

使用道具 举报

漫漫琳游的鱼 发表于 2015-2-25 13:44:40 | 显示全部楼层
感觉楼主offer妥妥的了,先cong一下~~BTW楼主治好了我多年的颈椎病
回复 支持 反对

使用道具 举报

抽你个不给力的 发表于 2015-3-8 12:48:02 | 显示全部楼层
hoping you nail it
回复 支持 反对

使用道具 举报

honeyee 发表于 2015-11-13 06:18:12 | 显示全部楼层
楼主好厉害
回复 支持 反对

使用道具 举报

clover1206 发表于 2015-11-13 06:29:10 | 显示全部楼层
多谢楼主分享,拿到offer妥妥的~
回复 支持 反对

使用道具 举报

本版积分规则

请点这里访问我们的新网站:一亩三分地Instant.

Instant搜索更强大,不扣积分,内容组织的更好更整洁!目前仍在beta版本,努力完善中!反馈请点这里

关闭

一亩三分地推荐上一条 /5 下一条

手机版|小黑屋|一亩三分地论坛声明 ( 沪ICP备11015994号 )

custom counter

GMT+8, 2017-3-29 21:43

Powered by Discuz! X3

© 2001-2013 Comsenz Inc. Design By HUXTeam

快速回复 返回顶部 返回列表