thoughtspot logo
Thoughtspot· SDE-2

ThoughtSpot | Coding, LLD | SDE-2

Posted
17 Jul 2023
362 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.

How it went

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.

Questions asked (3)

  1. 01

    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.

  2. 02

    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

  3. 03

    Design Logger

    System Design

    Design a Logger system.

Know someone preparing? Send it to them:WhatsAppLinkedInX

Interviewed at Thoughtspot recently?

Write up your rounds while you still remember the questions. It helps the next person more than you would think.

Share your experience
Discussion 0

Questions for the author, or how your own interview compared.

Join the discussion

Sign in with Google to comment or ask the author a question.

No comments yet

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