☕ US v Google?

A Facebook Interview Question. The US Department of Justice will bring antitrust action against Google. Amazon unveils Amazon One, a biometric technology that lets you pay with your hand.

Good Morning Planet Earth!

Hope you’re all having an awesome day!

Here’s your interview problem and industry news.

Interview Problem

You are given an array that contains an expression in Reverse Polish Notation.

Return the result from evaluating the expression. You can assume the expression will always be valid.

Input - [“2”, “3”, “+”, “3”, “*”]

Output - 15 because ( (2 + 3) * 5)

Input - [“4“, “5“, “/“, “30“, “+“]

Output - 30.8 because ( (4 / 5) + 30)

We’ll send out the solution (with working code & test-cases) tomorrow, so make sure you move our emails to primary, so you don’t miss them!

Gmail users—move us to your primary inbox

  • On your phone? Hit the 3 dots at top right corner, click "Move to" then "Primary"

  • On desktop? Back out of this email then drag and drop this email into the "Primary" tab near the top left of your screen

Apple mail users—tap on our email address at the top of this email (next to "From:" on mobile) and click “Add to VIPs”

Industry News

  • US Department of Justice is expected to sue Google as soon as next week - The US DOJ is planning on suing Google for antitrust violations. The Justice Department is investigating whether Google skews search results to favor it’s own products and whether it abuses it’s access to users to shut out rivals.European competition regulators have fined Google billions of euros for breaking antitrust laws but U.S. regulators have left the company mostly untouched since a 2013 FTC probe closed with no action. Now, the US Government is on the cusp of what could be the biggest monopoly case since their famous Microsoft lawsuit in 2001.

  • Amazon uses biometrics for identification in stores - Amazon has been experimenting with physical locations with their Amazon Go cashierless convenience stores. Customers previously identified themselves (when entering the store) by scanning their phones, but now they can do so by just scanning their palm. This is using a new biometric technology called Amazon One. The first time customers register to use this tech, they will have to scan their palm and insert their payment card at a terminal. After doing so, customers can pay with their hand for all future purchases. Currently, Amazon One is being unveiled in the Go stores in Seattle, Washington. However, Amazon plans on rolling out the tech to the rest of their Amazon Go locations. They also plan on selling the technology to other retailers.

Previous Solution

As a refresher, here’s the previous question

You are given a linked list as input. Determine if it has a cycle in it.

Can you do this using O(1) extra space?

Solution

The way you solve this is by utilizing a fast and slow pointer.

The fast pointer iterates through the linked list at 2 nodes per iteration.

The slow pointer iterates through the linked list at 1 node per iteration.

If the fast and slow pointer ever point to the same node, then you have a cycle in the list.

If the fast pointer reaches the end of the linked list, then you obviously don’t have a cycle and can return False.

Here’s the Python 3 code.