Skip to content
InterviewRounds

Interview experiences · newest first

Recently posted interviews.

First-hand experiences from candidates, round by round. Looking for one company? Browse companies.

California2 weeksNo offerMeh experience
01Phone ScreenTechnical45 minMedium

Interviewer: Software Engineer

Was asked to solve the following binary tree question

Problem Statement:

Given a binary tree where each node contains either an operator (+, -, *, /) or an integer. The tree represents a mathematical expression where each leaf node is an integer and each internal node is an operator that combines the values of its left and right subtrees. Evaluate the expression represented by the binary tree to return an integer value.

Example:

Input:
        *
       / \
      +   5
     / \
    3   2

Output: 25

Input:
        -
       / \
      *   4
     / \
    6   3

Output: 14
California6 weeksNo offerGood experience
01Phone ScreenTechnical45 minMedium

Interviewer: Senior SWE

I was asked a problem which was a variation of the LC combination-sum problem https://leetcode.com/problems/combination-sum/description/

Problem:

A customer at a restaurant wants to order appetizers that total a specific amount. Given a menu with item prices, find and return all possible combinations of items that sum to the target amount. If no combination is found, return an empty list.

Example Menu:

  • Nachos - $3.50

  • Spring Rolls - $2.80

  • Chicken Wings - $4.10

  • Fries - $3.20

Example #1:

Input: possible_order(6.70)
Output: [["Nachos", "Fries"], ["Spring Rolls", "Chicken Wings"]]

Example #2:

Input: possible_order(9.50)
Output: [["Nachos", "Chicken Wings", "Fries"], ["Nachos", "Spring Rolls", "Chicken Wings"], ["Spring Rolls", "Fries", "Chicken Wings"]]

Solution:

def possible_orders(target: float):
    menu = [
        ("Nachos", 3.50),
        ("Spring Rolls", 2.80),
        ("Chicken Wings", 4.10),
        ("Fries", 3.20)
    ]
    
    result = []

    # backtrack through combinations
    def backtrack(current_combination, start, current_sum):
        if current_sum == target:
            result.append(list(current_combination)) # found a valid combination
            return
        if current_sum > target:
            return

        for i in range(start, len(menu)):
            item, price = menu[i]
            current_combination.append(item)
            backtrack(current_combination, i, current_sum + price)
            current_combination.pop()  # backtrack
    
    backtrack([], 0, 0)

    return result

print(possible_orders(9.50))  # two combinations
print(possible_orders(5.30))  # one combination
print(possible_orders(10.50)) # no combination
Post-interview & closing thoughts

I passed the first technical phone screen but didn't make it through the second

Bay Area2 weeksNo offerMeh experience
01Phone ScreenTechnical45 minMedium

Interviewer: Software Engineer

Only had the first coding round of 45 mins where the interviewer asked to implement the "Connect Four" game, where two players alternately drop colored discs into a 7-column, 6-row grid. The goal is to be the first player to arrange four of their discs consecutively in a row, either horizontally, vertically, or diagonally.

I didn't do great and the interviewer wasn't much help when I got stuck.

Seattle2 weeksNo offerGood experience
01Phone ScreenTechnical & Behavioral60 minMedium

Interviewer: Software Engineer

The first 5 mins were introductions then we spent another 10-15 minutes talking about my past experiences and project. Then we jumped into a leetcode type coding problem.

Behavioral Question:

Tell me about a project you lead in the past.

Technical Problem:

Given an array of unsorted integers, determine the length of the longest sequence of consecutive integers that can be formed. The solution must run in linear time complexity.

Input: [100, 4, 200, 1, 3, 2]
Output: 4 # longest consecutive sequence is [1, 2, 3, 4]

Input: [-1, -2, 0, 1, 2, 3]
Output: 5 # sequence [-2, -1, 0, 1, 2, 3].

Input: [0, 0, 1, 2, 2, 3, 4, 5]
Output: 6 # sequence [0, 1, 2, 3, 4, 5]

Solution:

public class Solution
{
    public int LongestConsecutive(int[] nums)
    {
        var numSet = new HashSet<int>(nums);
        int longestStreak = 0;

        foreach (int num in numSet)
        {
            if (!numSet.Contains(num - 1))
            {
                int currentStreak = 1;
                while (numSet.Contains(num + currentStreak))
                {
                    currentStreak++;
                }
                longestStreak = Math.Max(longestStreak, currentStreak);
            }
        }

        return longestStreak;
    }

    public static void Main()
    {
        var solution = new Solution();
        int[] nums = { 100, 4, 200, 1, 3, 2 };
        Console.WriteLine(solution.LongestConsecutive(nums));  // Outputs 4
    }
}

Both time and space complexity is O(n)

California4 weeksNo offerMeh experience
01Phone ScreenTechnical45 minMedium

Interviewer: SWE

Had to solve two leetcode questions in 45 minutes, one easy and the other hard difficulty. Didn't make it to the next round.

Question #1:

Largest common substring: Given two strings, s1 and s2, find the length of the largest substring that is common between the two strings.

Input:
s1 = "hello"
s2 = "yellow"

Output: 2 # common substring is "llo"

Questions #2:

Minimum remove to make valid parentheses: given a string s consisting of lowercase english characters and parentheses ( and ), remove the minimum number of parentheses to make the string valid.

Input:
s = "(a(b(c)d)"

Output:
"a(b(c)d)"
Los Gatos2 weeksNo offerMeh experience
01Phone ScreenTechnical45 minMedium

Interviewer: Software Engineer

I was asked to implement a TTL cache similar to the leetcode cache problem with the following methods:

set(key, value, duration) : sets a key-value along with it's expiration time

get(key) : returns the value associated with key if it's still valid

count(key) : returns unexpired key count

Follow-up:

There were follow-ups on scaling the cache system to handle scenarios where multiple clients are concurrently reading and writing to the cache, and possible performance optimizations

Tips:

Be sure to cover all possible edge cases and think aloud to clarify any assumptions

Seattle2 weeksNo offerMeh experience
01Online AssessmentTechnical90 minHard

One of the questions from the OA

Question:

Imagine Amazon warehouses arranged in a circle. You can start at any warehouse and move either clockwise or counterclockwise, but you must stick with your chosen direction for the entire process.

Each warehouse has a different number of items, and the goal is to redistribute them so that every warehouse ends up with the same amount. It’s guaranteed that this is possible.

The distance between neighboring warehouses is 1 unit, and moving an item costs the same as the distance it travels. The goal is to find the best starting point and direction to minimize the total cost.

Example

Let’s say the warehouses have the following counts: 3 -> 4 -> 6 -> 6 -> 6 (looping back to 3).

To balance the items:

  1. Start at the third warehouse (with 6 items). Collect 1 item from the 3rd, 4th, and 5th warehouses.

  2. Deliver 2 items to the first warehouse (which has 3) and 1 item to the second warehouse (which has 4).

By the end, each warehouse will have 5 items, and the total cost would be 1 + 2 + 4 = 7.

Total Cost Breakdown:

  • Moving from the 5th warehouse to the 1st warehouse costs 1.

  • Moving from the 4th warehouse to the 1st warehouse costs 2.

  • Moving from the 3rd warehouse to the 2nd warehouse costs 4.

California2 weeksNo offerBad experience
01Phone ScreenTechnical45 minHard

Interviewer: Senior SWE

Jumped straight into questions, was given the valid palindrome leetcode problems.

Question: Valid Palindrome II

Given a string s, determine if it can form a palindrome by removing at most one character. Return true if it can, and false otherwise.

Input: "abca"
Output: true  removing 'b' results in the palindrome "aca"

Input: "abcdef"
Output: false

Follow-up question was the valid palindrome III problem:

Given a string s and an integer k, determine if the string is a K-Palindrome. A string is considered a K-Palindrome if it can be transformed into a palindrome by removing no more than k characters

Input: s = "aebcbda", k = 1
Output: true

Input: s = "abcdef", k = 1
Ouput: false
California3 weeksNo offerGood experience
01Phone ScreenTechnical45 minMedium

Interviewer: Software Engineer

Was asked the robot signals problem, made some mistakes while trying to come up with an optimal approach.

Question:

You’re receiving signals from a robot, each with a timestamp (sorted in chronological order) and a message. Your task is to print messages that are unique within the last 10 seconds.

Input:

[{timestamp: 2, message: "Ready"}, {timestamp: 4, message: "Ready"}, {timestamp: 9, message: "Go"}, {timestamp: 15, message: "Stop"}]

Output: "Ready Go Stop"

Follow-up:

Need to drop duplicates that occur both in the past and the future 10-second window

Input:

[{timestamp: 0, message: "Start"}, {timestamp: 3, message: "Start"}, {timestamp: 5, message: "Move"}, {timestamp: 9, message: "Pause"}, {timestamp: 14, message: "Move"}]

Output: "Start Pause"

Approach:

We can use a hashmap to store the messages as keys and the timestamps as values. Iterate through the list of messages and check whether a message has already been seen and if it falls within the 10-second window.

Menlo Park3 weeksNo offerMeh experience
01Phone ScreenTechnical45 minEasy

Interviewer: Senior SWE

Given a string, remove the minimum number of parentheses to make the string valid.

Examples:

Input: "a)b(c)d"

Output: ab(c)d

Python solution:

def min_remove_to_make_valid(s: str) -> str:
    stack = []
    to_remove = set()
    
    # identify parentheses to remove
    for i, char in enumerate(s):
        if char == '(':
            stack.append(i)
        elif char == ')':
            if stack:
                stack.pop()
            else:
                to_remove.add(i)
    
    # add remaining unmatched '(' indices to to_remove
    to_remove.update(stack)
    
    # build the result string without the indices in to_remove
    result = []
    for i, char in enumerate(s):
        if i not in to_remove:
            result.append(char)
    
    return ''.join(result)


s = "(a(b(c)d)"
print(min_remove_to_make_valid(s))  # outputs => "a(b(c)d)"