Oracle | Senior MTS | Seattle | Jan 2020

Target: Oracle, senrior member of technical staff
Four 1 hour rounds, each with technical + behavioral + some design.

Round 1

Tell me about a time when you were unable to meet deadlines.

Given a postfix expression (input: vector of strings), covert it into an infix expression(output: one string) with no redundant braces.

Example

Input: ["12", "11", "y", +, "5", "6", "-", "/", \*, "6", "/"]
Output: "12 * (11 + y)/(5 - 6) / 6"

Design a bit.ly like URL shortening service.

  • service takes a URL and return a shortened version
  • users can register on the service and previous shortened URLs

Round 2

You are given an 2-D matrix with nulls at some points and servers at others. Return a new matrix with the manhattan distance of the each point from the closest server.

Example:

Input:
[['x', 'x', 'x']
,['s', 'x', 's']
,['x', 'x', 'x']
,['x', 's', 'x']]

Output:
[['1', '2', '1']
,['0', '1', '0']
,['1', '1', '1']
,['1', '0', '1']]

Follow up:

How would you store the input matrix if the count of nulls was in billions, but the server were in thousands.

Round 3

Given a number N, return the minimum count of perfect squares that sum upto N.

Example

foo(6) returns 3 // 4 + 1 + 1
foo(41) returns 2 // 16 + 25

Follow up

Given a number N, return a array of perfect squares, with minimum count, that sum upto N.

Example

foo(6) returns [4, 1, 1]
foo(41) returns [16, 25]

Round 4

Design contraints

You are given a system with these properties:

  • The system is a social media platform
  • Each user gain points on the platform through various activities such as:
    • 5 points for signing up
    • 1 point for daily check-in
    • 3 points for referrals
  • The system displays users' current points and their overall rank across all users on the websites' banner (always visible on the website)
  • The banner should be kept up to date.
  • There are about 200M total users.

Question

Design a point manager class with these APIs

- AddPoints(int pointsToIncrement, GUID userId)
- GetPoints(GUID userId)
- GetRank(GUID userId)

Follow-up

You may have assumed that pointsToIncrement is relatively very small compared to the range points.
You no longer have this assumption. The APIs runtime should be around logarthmic time.

Comments (1)