Meta | E5/E6 | Virtual Onsite | Seattle
Anonymous User
1696

Had a virtual onsite split into 2 days.

Day 1/ Day2:

  1. Coding round:
You have an encoding that maps each letter to a number

A -> 0 B -> 1 ... K -> 10 ... U -> 20 ... Z -> 25

given an encoded string e.g. '911', find the total number of possible encoding strings that can be generated.

Example: '10' => ['BA', 'K'] => 2; '911' => ['JBB', 'JL'] => 2; '1' => ['B'] => 1
Sink zeroes down in binary tree, requirements: 
1. Only swap values between nodes
2. After completion, either the zero node is the leaf node or the subtree of the zero node contains only zero nodes

I was able to complete the second one using post order traversal. For first question, I did DP but interviewer was not fully convinced with the solution.

  1. System Design Round: In this round Interviewer asked about purchasing tickets that will open on a particular slot. Please do not get it confused with Ticket Master. The whole design was different. Considering below requirements
  • 50000 users trying to buy tickets. May be 10,000 tickets in total.
  • Any user (no login/registration) can come and ask for number of tickets, if available just purchase it.
  • hold period of 5 mins for users.
  • support if no ticket left but there are tickets on hold.

I was able to design it but not able to do time management and this way lot of things that i know was not able to communicate with the interviewer.

  1. Coding round:
Given an array of integers and a window size, write a function that returns average value for each rolling window.


Context: Consider an array of integers and integer k . For each element X in the array one can construct a slice of the array that includes X and k-1 elements before X ( k elements in total) - this is called 'rolling window', and k is called 'window size'


Example:
input = [1,2,3,4,5]
window_size = 3
output = [2.0, 3.0, 4.0]
https://leetcode.com/problems/meeting-rooms-ii/description/

This round, I was able to complete both the questions on time.

  1. System Design: Ad Click Aggregator
  2. Behavioral
Comments (8)