← 返回博客列表
Amazon

Amazon 面試題詳細解析:多維度考察 (LP, LRU)

2025-09-19

Amazon 面試非常注重 Leadership Principles (LP) 和演算法能力。本文詳細解析 Amazon 面試全流程,oavoservice 助你全面準備。

📋 Amazon Leadership Principles (領導力準則)

  1. Customer Obsession - 客戶至上
  2. Ownership - 主人翁精神
  3. Invent and Simplify - 創新簡化
  4. Learn and Be Curious - 好學若渴
  5. Hire and Develop the Best - 選賢育能 ... (以及其他 11 條)

🎯 演算法題目

題目:設計 LRU 快取 (LRU Cache)

class Node:
    def __init__(self, key=0, val=0):
        self.key = key
        self.val = val
        self.prev = None
        self.next = None

class LRUCache:
    def __init__(self, capacity):
        self.capacity = capacity
        self.cache = {}
        self.head = Node()
        self.tail = Node()
        self.head.next = self.tail
        self.tail.prev = self.head
    
    def _add_node(self, node):
        node.prev = self.head
        node.next = self.head.next
        self.head.next.prev = node
        self.head.next = node
    
    def _remove_node(self, node):
        prev = node.prev
        new = node.next
        prev.next = new
        new.prev = prev
    
    def _move_to_head(self, node):
        self._remove_node(node)
        self._add_node(node)
    
    def _pop_tail(self):
        res = self.tail.prev
        self._remove_node(res)
        return res
    
    def get(self, key):
        node = self.cache.get(key)
        if not node:
            return -1
        self._move_to_head(node)
        return node.val
    
    def put(self, key, value):
        node = self.cache.get(key)
        
        if not node:
            newNode = Node(key, value)
            self.cache[key] = newNode
            self._add_node(newNode)
            
            if len(self.cache) > self.capacity:
                tail = self._pop_tail()
                del self.cache[tail.key]
        else:
            node.val = value
            self._move_to_head(node)

🗣 行為面試範例

Q: Tell me about a time you failed (談談你失敗的一次經歷)

STAR 回答框架:

Situation (情境): 在一個緊急專案中,我負責開發核心功能模組。

Task (任務): 需要在兩週內完成開發和測試。

Action (行動):

Result (結果):

💼 oavoservice 助力

LP 準備 - 14 條領導力原則 演算法深度 - Amazon 高頻題目 行為面試 - STAR 方法指導 系統設計 - 大規模系統架構

聯繫 oavoservice,專業 Amazon 面試輔助!


標籤: #Amazon #LeadershipPrinciples #LRU #行為面試 #VO輔助 #面試輔助 #一畝三分地


需要面試真題? 立刻聯繫微信 Coding0201獲得真題