Amazon interview questions | Software Engineer

Amazon Coding Round Interview Questions

  • Given an array of distinct elements and a number x, find if there is a pair with product equal to x.
  • Given a string ‘str’ of digits and an integer ‘n’, build the lowest possible number by removing ‘n’ digits from the string and not changing the order of input digits.
  • Given a number, find its corresponding Roman numeral.

Amazon System Design Interview Questions

  • Design a system that controls traffic lights with below assumptions:
  • A group of traffic lights has two components: main lights and pedestrian lights.
  • Main traffic lights has three colors: red, yellow and green.
  • Pedestrian lights has two colors: red and green.
  • Pedestrian lights’ colors are reversed from main lights:
    • Main: red/yellow – pedestrian’s: green
    • Main: green – pedestrian: red
  • There is a button for pedestrian lights if the button is pushed in advance, pedestrian’s lights change colors according to the main ones if the button isn’t pushed, pedestrian’s lights remain red.
  • A typical junction has 4 groups of lights.
  • Additional question: design the system in a way that allows cars which start from one junction after a red light don’t have to stop at the next one.