ThoughtSpot | Coding, LLD | SDE-2
Anonymous User
1359

Secound round (Coding):

  1. You are given an array arr & integer k, need to find count of distinct elements for each subarray of size k.

Solved it using 2 pointers & hashmap

  1. You are given a snake and ladder board of size MxN. 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.

M=5, N=6 ---- 30

Snake: 7->4, 16->2, 29 -> 11

Ladder: 3->19, 22->28

Answer: 3

solved it using graphs traversal,

where edges would be :

all snakes
all ladders
and for each cell there is an edge to each of next 6 cells.

we need to find the minimum shortest path between edge to node 1 to node M*N.


Third roud (LLD) : Design Logger.

Comments (2)