amazon 面经

(1)聊聊平时用到的基本数据结构,各有什么优劣,以及什么时候该用哪个数据结构;
(2)聊一个自己成功的research project。着重谈谈这个project成功的几个关键步骤;
(3)一个2D矩阵,每个单元都是一个字符。相邻字符可以连起来,这样就可以逐渐组成
一个单词。(一个字符可以和周围8个方向的相邻字符连接)。但是在一个单词中,同
一个位置只能经过一次。打印出所有合法单词,不重复。

 

What is encapsulation?

Ans) The encapsulation is achieved by combining the methods and attribute into a class. The class acts like a container encapsulating the properties. The users are exposed mainly public methods.The idea behind is to hide how thinigs work and just exposing the requests a user can do.

 

What is the different between hashtable and hashmap.

There are several differences between HashMap and Hashtable in Java:

  1. Hashtable is synchronized, whereas HashMap is not. This makes HashMap better for non-threaded applications, as unsynchronized Objects typically perform better than synchronized ones.
  2. Hashtable does not allow null keys or values. HashMap allows one null key and any number of nullvalues.
  3. One of HashMap's subclasses is LinkedHashMap, so in the event that you'd want predictable iteration order (which is insertion order by default), you could easily swap out the HashMap for a LinkedHashMap. This wouldn't be as easy if you were using Hashtable.

 

现个丑,我也当过亚马逊的面试官,其实一天下来,真正在考你ood和coding的只有一
场,其他都是在考你解决问题的能力,应对不确定性时的能力等等,你们好歹也了解一
下公司背景啊,google关键字amazon leadership principles。

 

 

 

 

Amazon leader principle
Whether you are an individual contributor or the manager of a large team, you are an Amazon leader. These are our leadership principles and every Amazonian is guided by these principles.


Customer Obsession
Leaders start with the customer and work backwards. They work vigorously to earn and keep customer trust. Although leaders pay attention to competitors, they obsess over customers. 

Ownership
Leaders are owners. They think long term and don’t sacrifice long-term value for short-term results. They act on behalf of the entire company, beyond just their own team. They never say “that’s not my job." 

Invent and Simplify
Leaders expect and require innovation and invention from their teams and always find ways to simplify. They are externally aware, look for new ideas from everywhere, and are not limited by “not invented here." As we do new things, we accept that we may be misunderstood for long periods of time. 

Are Right, A Lot
Leaders are right a lot. They have strong business judgment and good instincts. 

Hire and Develop the Best
Leaders raise the performance bar with every hire and promotion. They recognize exceptional talent, and willingly move them throughout the organization. Leaders develop leaders and take seriously their role in coaching others. 

Insist on the Highest Standards
Leaders have relentlessly high standards - many people may think these standards are unreasonably high. Leaders are continually raising the bar and driving their teams to deliver high quality products, services and processes. Leaders ensure that defects do not get sent down the line and that problems are fixed so they stay fixed. 

Think Big
Thinking small is a self-fulfilling prophecy. Leaders create and communicate a bold direction that inspires results. They think differently and look around corners for ways to serve customers. 

Bias for Action
Speed matters in business. Many decisions and actions are reversible and do not need extensive study. We value calculated risk taking. 

Frugality
We try not to spend money on things that don’t matter to customers. Frugality breeds resourcefulness, self-sufficiency, and invention. There are no extra points for headcount, budget size, or fixed expense. 

Vocally Self Critical
Leaders do not believe their or their team’s body odor smells of perfume. Leaders come forward with problems or information, even when doing so is awkward or embarrassing. Leaders benchmark themselves and their teams against the best. 

Earn Trust of Others
Leaders are sincerely open-minded, genuinely listen, and are willing to examine their strongest convictions with humility. 

Dive Deep
Leaders operate at all levels, stay connected to the details, and audit frequently. No task is beneath them. 

Have Backbone; Disagree and Commit
Leaders are obligated to respectfully challenge decisions when they disagree, even when doing so is uncomfortable or exhausting. Leaders have conviction and are tenacious. They do not compromise for the sake of social cohesion. Once a decision is determined, they commit wholly. 

Deliver Results
Leaders focus on the key inputs for their business and deliver them with the right quality and in a timely fashion. Despite setbacks, they rise to the occasion and never settle. 

 

 

 

 

  1. judge if a tree is balanced
  2. What is a hash table and what would you use it for?
  3. Write the a function that counts all pairs in an array.
  4. Given million records, sort them out using 1K memory. Suggest the best algorithm to do this
    1. Find all the common elements between two arrays.
  5. Write code to check if a given tree is a Binary Search Tree (BST).
  6. Design a hotel reservation system.
  7. Design an elevator system using object oriented methodologies.
  8. Given two arrays, write a method to find their intersection?
  9. Design a Least Recently Used (LRU) cache.
  10. What is a hash map? How could you use hash maps to find the intersection between two arrays faster?
  11. Give an object oriented design for a restaurant reservation system.
  12. Design a Chess game with OOD
  13. How to design a cross-road traffic light system?
  14. How to design Amazon’s warehouse shipping system?
  15. Say you had a dictionary of words. How would you set it up? And what would you do if you needed to search for a word (what type of search)? About how long would it take for you to search for the word using Big O notation?

转载于:https://www.cnblogs.com/leetcode/p/3555987.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值