CoinDCX Interview Questions | SDE-2 | Backend

coindcx logo
coindcx
SDE-2
April 2, 20255 reads

Summary

This post details my interview experience for an SDE-2 Backend role at CoinDCX, focusing on two specific coding questions.

Full Experience

My interview for the SDE-2 Backend role at CoinDCX primarily focused on problem-solving, and I was presented with the following two data structures and algorithms questions.

Interview Questions (2)

Q1
Can Visit All Rooms
Data Structures & AlgorithmsMedium

N rooms numbered from 0 to n-1 initially only 0th room is unlocked. Rooms will have keys for any rooms. We need to find if we can visit all the rooms.

Input: [[1], [2], [3], []] output : true

We start in room 0 and pick up key 1. We then go in room 1 and pick up key 2. We then go in room 2 and pick up key 3. We then go in room 3. Since we were able to go to every room, we return true.

Input: [[1,3], [3,0,1], [2], [0]] Output: false We can't enter room with number 2 0 -> 1, 3 1 -> 0, 1, 3 2 -> 2 3 -> 0

Q2
Minimum Street Lights to Cover Houses
Data Structures & AlgorithmsMedium

You are given location of n number of houses on a straight line and k street lights. The street light has a power P value.

If a street light is located at location x, it will spread light from [x-P , x+P]

You need to find the minimum value of K so that we can light all the houses.

Example1:

houses[] = [1,2,3,4,5] P = 1 output = 2

Example2: houses[] = [7,2,4,6,5,9,12,11] P = 2 output = 3

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!