Amazon prep.

wonderful world·2022년 9월 20일
0

amazon(canada) final on-site interview prep.

D-1

plan

20 pomo in total
elapsed: 6, +1
4:4:2 = coding:behavior:system

coding: 8 pomo
behavior: 8 pomo
system: 2 pomo

coding

10 - 12 : 4 pomo
1 - 3 : 4 pomo

behavior

3-4 2 pomo
4-5 2 pomo


5-8 break: 저녁 식사 및 놀기


8-9 2 pomo
9-10 2 pomo

other works

9:10 - 9:35

system design

10-11 2 pomo

Design a network of vending machines where customers can collected their food items ordered on Amazon.com. Follow-up was to extend this system to enable suppliers to stock the vending machines. Focus was placed on high-level design, scalability, and details of the back-end system design. Also, each design decision had to be justified.

Design a game-controller to administer two games: Tic-Tac-Toe (traditional 3x3 board and a more generic mxn board) and Connect-4 (a generic mxn board). Focus was more on object-oriented design and the use of appropriate design patterns. The interviewer wanted to see various classes and their relationships, and some basic APIs to manage these games.

11-12 2 pomo


coding 준비

1. 빈번히 출제되는 문제 풀어보기

기출문제

course schedule

    # Space complexity: O(V + E) since we are storing all the prerequisites for each task in an adjacency list
    def canFinish(self, N: int, prerequisites: List[List[int]]) -> bool:
        # [x,y] : y is prerequsites for x
        
        # 1. initialize the graph 
        in_degree = {i: 0 for i in range(N)} # incoming edges
        graph = {i: [] for i in range(N)} # adjacency list
        
        # 2. build a graph
        for parent, child in prerequisites:
            in_degree[child] += 1
            graph[parent].append(child)
        
        # 3. find all sources. all vertices with 0 in-degree
        #print ('in_degree', in_degree)
        sources = collections.deque()
        for key in in_degree:
            if in_degree[key] == 0:
                sources.append(key)
                
        # 4. detect cycle: whenever visit a node, decrement in_degree by 1. 
        # if any node's in_degree becomes negative, it would be a cycle.
        #print ('sources', sources)
        sorted_order = []
        while sources:
            key = sources.popleft()
            sorted_order.append(key)
            for child in graph[key]:
                in_degree[child] -= 1
                if in_degree[child] == 0:
                    sources.append(child)
                    
        return len(sorted_order) == N

substring with largest variance

class Solution:
  def largestVariance(self, s: str) -> int:
    # a := the w// higher freq
    # b := the w// lower freq
    def kadane(a: str, b: str) -> int:
      ans = 0
      countA = 0
      countB = 0
      canExtendPrevB = False

      for c in s:
        if c != a and c != b:
          continue
        if c == a:
          countA += 1
        else:
          countB += 1
        if countB > 0:
          # an interval should contain at least one b
          ans = max(ans, countA - countB)
        elif countB == 0 and canExtendPrevB:
          # edge case: consider previous b
          ans = max(ans, countA - 1)

        # reset if # of b > # of a
        if countB > countA:
          countA = 0
          countB = 0
          canExtendPrevB = True

      return ans

    return max(kadane(c1, c2)
               for c1 in string.ascii_lowercase
               for c2 in string.ascii_lowercase
               if c1 != c2)

Grokking coding interview

union-find

top 'k' elements

use ok Heap

behavioral interview 준비

be specific
60 seconds
give number/data.

https://www.lewis-lin.com/blog/2018/6/13/lewis-c-lins-amazon-interview-spreadsheet
스프레드쉬트

Amz leadership principles, really general and the interviewer may ask you focus on some specific deatails when you talk about about the experience and project:
how to handle conflict
tight deadline
leadership in the team/project
what aspects would you improve if you do it again

"Strongly disagreed with your manager or peer"
"Tough or critical piece of feedback you received"

did you ever disagree with project manager?

The most important part for LP questions is, your answers should not be repeated. It looks redundant as the interviewer would have read your past feedback. This was a tip I received from the HR.

what's your biggest achievement?

how do you assess your current boss, which area he needs to improve.

How do you handle difference between you and your boss.

How do you hanle work pressure and how do you blance work and life.

https://dev.to/freeze_francis/amazon-sde-3-interview-3df6

The interview was with a Principle Product Manager and was completely behavioral. He asked the following:
situations where I worked on an ambiguous project.
situations where I had to convince the entire team to break the norm and do things differently.
Situations where you had to go beyond your comfort zone.
situations where you had to persuade your stakeholders to take a different approach.
situations where you disagreed with your team’s solution and convinced them with yours.
situations where you had to make a difficult decision.
situations where you had to agree with the team even though you disagreed.
Round 5. bar raiser
situations where you had a simple fix for a complex problem.
situations where you had an innovative idea that made its way to production.

QC, RN is in conflict situation? supporting is out of scope. consult with Google. give dettailed architecture to QC.

system design 준비

5.5 hour in total (11 pomo)
OK.1 3:50 - 4:15 survey existing system design questions
OK.2 4:20 - 4:45 survey
OK.3 4:50 - 5:15 survey: principle PM => completely behaviroal
break 50m
OK.4 6:10 - 6:35 survey & online bookstore
OK.5 Design Parking Garage : load balancer, read repliaca, SQL
OK.6 Cloud Engieering Interview Questions and Concepts :

  • what is load balancer
  • what is the difference between horizontal scaling and vertical scaling
  • what is the defference between SQL and NoSQL => relational VS. non-relational
  • what is database sharding => splitting a database into multiple smaller pieces called shards

OK 9:15 - 9:45 daily leetcode
break 9:50 - 10:15
10:00 - 10:25 tiny url, weather forecast system
10:30 - 10:55
11:00 - 11:25

기존 문제들

https://brunch.co.kr/@worker-in-yvr/12
url 단축서비스
페이스북 친구의 게시물을 시간순으로 보기 위한 시스템

https://leetcode.com/discuss/interview-experience/1348383/Amazon-Rejection

Elevator system: asked to provide with the APIs. Tried to route the direction to elevator assignment + consistency+atomicity+sharding, he instead insisted on explaning the api flow.

https://dev.to/freeze_francis/amazon-sde-3-interview-3df6

System design: He asked to expose the above solution as a service and scale it to handle a large number of requests.

https://leetcode.com/discuss/interview-experience/2272462/Amazon-sde-2

Design BookMyShow using OO Principles and define classes, models etc
Design TinyUrl App

https://leetcode.com/discuss/interview-experience/1502893/Amazon-SDE2-Interview-Expericen

scaling for the parking lot ticketing system. Interviewer kept changing the requirement how to handle the ticketing system and added lots of use cases.
https://www.youtube.com/watch?v=gNQ9-kgyHfo&list=WL&index=8

https://leetcode.com/discuss/interview-experience/1128717/Amazon-SDE2-Bengaluru

design a system that could send email notifications in bulk. Focus was primarily on failure scenarios and handling.

https://leetcode.com/discuss/interview-experience/913583/Amazon-or-SDE2-or-REJECT

Asked me to design facebook.
HLD.
Why SQL DB?
How many DB boxes?
How will caching work?
Bottlenecks in the system?
CDN for photos, videos?

Asked me to design YOUTUBE.
Lots n lots of questions on CDN, permanent data stores, DB to be used, how will i make feed, updating the feed, asked me to wrtie Upload API and how it will work, how will it divide a big video file.

leedcode:amazon-onsite-interview-questions-sde-ii

Q.2: Design a network of vending machines where customers can collected their food items ordered on Amazon.com. Follow-up was to extend this system to enable suppliers to stock the vending machines. Focus was placed on high-level design, scalability, and details of the back-end system design. Also, each design decision had to be justified.

Q4: Design a game-controller to administer two games: Tic-Tac-Toe (traditional 3x3 board and a more generic mxn board) and Connect-4 (a generic mxn board). Focus was more on object-oriented design and the use of appropriate design patterns. The interviewer wanted to see various classes and their relationships, and some basic APIs to manage these games.

leetcode:AMAZON | Onsite | SDE-2

Design a highly scalable Movie Ticket Booking System

Amazon | SDE2 L5 | London, UK | Sep 2022 (Offer)

System Design Interview (30 mins) + Leadership Principles (20 mins):
Design a system to ingest IOT sensor data, store and display it


reference

Behavioral question
Amz leadership principles, really general and the interviewer may ask you focus on some specific deatails when you talk about about the experience and project:

how to handle conflict
tight deadline
leadership in the team/project
what aspects would you improve if you do it again


  • coding: LRU cache, Reverse LL, graph based shortest path
  • system design:database for memory hugry apps, movie ticket booking system

Amazon Group prep. call

SW II, level5

Logistics

interview on CHIME(video)

  • Live Code Link for accessing code (3 coding)
    • simple window. no ide
  • Digital Whiteboarding options- Awsapp.com, Draw.io, lucid charts etc
  • break (flex time, lunch/dinner between interviews)
  • final schedule to be sent by the Recruitment Coordinator 2 days before the day

BEHAVIORAL

SDEII L5
70% behavioral competency (all the interview rounds)
30% technical

  1. understand leadership principle make a stroy
  2. ownership, curious,
    deliver results, have a backbon, disagree-commit,
    insists on highest standards, bias for action
  3. one story hits multiple principles
    try to have more than 2 principles
  4. each story to be backed up with data in your story telling
    KPI key performance indicator measuring ensure metrics
  5. star method (situation, task, action, result)

I Vs We:

CODING ROUNDS

interview breakdown (4 rounds)
r1. coding-problem solving
r2. coding-data structures and algorithms
r3. coding-logical, maintainable and extensible code
r4. system design

data structure and algo

언제/어떻게 쓰는 지가 더 중요.

  • inner working of common DS and should be able to compare and contrast their usage in different applications
  • DS to revise problems in hash map, lists, graph, priority queues, bst, traversal, tries, satck, heap
  • algo - consider reviewing traversals, divide and conquer and BFS VS DFS, DP, greedy alorithm
  • manage time

logical maintainable and extensible code

  • scalable, robust and well tested code
  • syntax free code, no pseudo code
  • try coding without an IDE for practice

problem solving

more abstract. discover, design, demonstrate
70~80% candidates 가 실패. 질문 안함. requirement gathering 안함.
코딩 전 생각을 말하기. demonstrate your choice why.

  • ask clarifying questions
  • interact with the interviewer
  • take hints

SYSTEM DESIGN

design a large, highly distributed and highly scalable system

  • gathering requirements and asking clarifying questions
  • questions around scope and scale
  • use arrows and boxes to show components and flow
  • most important factors - scaling and operational excellence
  • important concepts - API, storage, communication
  • talk about pros and cons of your decisions
  • raise concerns or call-outs/talk about scale
  • grap analysis - is this design ultimately doing what it is supposed to do?
  • justification/articulation of choices - pros/cons or tradoffs.

PREP LINK VIDEOS

amazon(canada) online technical phone screen

  1. introduce the job
  2. self-introduce => 잘 못함 ㅠㅠ 왜 이걸 준비 안 했지?
    1. question: experience for developing (backend?) service
  3. class vs. object
  4. why use inheritance? => 대답 잘 못함 ㅠㅠ 한심하다 정말..
  5. data structure question
    1. (linked list) describe and when to use? => 대답 잘 못함.
    2. (hashtable) describe and what is hashing and how to hash => 대답 잘 못함
  6. design class for deck of cards (52, face: diamond, .., value: 0, 1, ..)
  7. coding test (without running. just like penpil coding) => 난이도가 뭐지?..
    1. print odd number from M to N
    2. time complexity and number of iteration
  8. database questions => 대답 잘 못함
    1. design table for theater, movie, showtime, ...

coding test 난이도가 말이 안 되게 낮았으나 제대로 못 알아들어서 iteration 수를 줄이는 건데 time complexity 를 줄이라는 말인 줄 알고 한참동안 멍때림.. O(N) 을 어떻게 더 줄이지?

online accessment 에선 leetcode 기준으로 medium 과 hard 문제가 나와서 이번에도 그런 줄 알았는데 왜 저런 걸 물어보나 싶을 정도로 허무했지만, data structure 나 design, database 질문에서 제대로 답을 못해서 떨어질 것으로 예상.

전체적으로 영어를 못해서 의사소통이 지장이 있다는 느낌을 많이 줌. sorry one more time 만 열번 넘게 한 듯? ... 전화 영어 등록하자..

업데이트: 이상하지만 technical phone screen 보고 28시간 후 통과했다는 이메일옴. final virtual onsite interview 가 한국시각 아침7시부터 점심12시까지 5시간동안 진행예정이라고 함.

profile
hello wirld

0개의 댓글