Summary
I recently interviewed for an SDE-2 role at ThoughtSpot, which involved coding rounds focusing on array/hashmap problems and graph traversal, followed by a Low-Level Design round.
Full Experience
Coding Round 1
The first coding question involved an array and an integer k. I needed to find the count of distinct elements for each subarray of size k. I solved this problem effectively using a two-pointer approach combined with a hashmap.
Coding Round 2
The second coding problem was a classic Snake and Ladder board game scenario. I was given an M x N board, along with the start and end points for snakes and ladders. The goal was to find the minimum number of dice throws required to reach the last cell from the first. For example, with M=5, N=6 (total 30 cells), snakes at 7->4, 16->2, 29->11, and ladders at 3->19, 22->28, the answer was 3. I approached this by modeling the board as a graph. The edges in my graph included all snakes, all ladders, and for each cell, an edge to the next six cells (representing dice throws 1 to 6). My task was to find the minimum shortest path from node 1 to node M*N.
Low-Level Design (LLD) Round
The LLD round focused on designing a Logger system.
Interview Questions (3)
You are given an array arr and an integer k. You need to find the count of distinct elements for each subarray of size k.
You are given a snake and ladder board of size M x N. You are also given start and end points of the snakes and ladders. Find the minimum number of dice throws required to reach the last cell from the first.
Example:
M=5, N=6(total 30 cells)- Snakes:
7->4, 16->2, 29->11 - Ladders:
3->19, 22->28
Expected Answer: 3
Design a Logger system.