ThoughtSpot | Coding, LLD | SDE-2

thoughtspot logo
thoughtspot
SDE-2
July 17, 20230 reads

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)

Q1
Count Distinct Elements in Subarrays of Size K
Data Structures & Algorithms

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.

Q2
Snake and Ladder Game - Minimum Dice Throws
Data Structures & Algorithms

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

Q3
Design Logger
System Design

Design a Logger system.

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!