Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Disney + Hotstar interview experience Real time questions & tips from candidates to crack your interview

SDE - 1

Disney + Hotstar
upvote
share-icon
3 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 8 months
Topics: Data Structures, Pointers, OOPS, System Design, Algorithms, Computer Networking, Object Oriented Programming, ML
Tip
Tip

Tip 1 : Never leave any topic from any chapter / Subject
Tip 2 : Learn to explain your thoughts well
Tip 3 : Learn from previous experiences / interviews / problems asked.
Tip 4 : Atleast 4 projects in Resume

Application process
Where: Referral
Eligibility: No criteria
Resume Tip
Resume tip

Tip 1 : Atleast 4 projects on Resume
Tip 2 : Do not write false things. You always get caught. Be genuine.

Interview rounds

01
Round
Medium
Video Call
Duration60 mins
Interview date24 Aug 2022
Coding problem2

This round was taken by an 2-year experienced engineer. This round was primarily to test coding ability so 2 DSA questions were asked

1. Decode String

Easy
0/40
Asked in companies
Expedia GroupDisney + HotstarMicrosoft

Ninja requests a PS5 from Santa on Christmas. Santa decides to give Ninja a brand new PS5, but he locks it in a safe and gives Ninja a string SECRETCODE. The password to open the safe is the length of the longest palindromic subsequence present in SECRETCODE.

A palindromic subsequence is a subsequence (generated by deleting some character of a given string without changing its order) which is a palindrome. For example: ‘ABBA’ is the longest palindromic subsequence for ‘CACBDBA’.

As Ninja is busy sending Christmas presents to his friends, he asks you for help. Can you help Ninja open the safe and retrieve his PS5?


Note:

‘SECRETCODE’ consists of only English uppercases.


Problem approach

Every time we meet a '[', we treat it as a subproblem so call our recursive function to get the content in that '[' and ']'. After that, repeat that content for 'num' times.
Every time we meet a ']', we know a subproblem finished and just return the 'word' we got in this subproblem.

Try solving now
Easy
10m average time
90% success
0/40
Asked in companies
Disney + HotstarMicrosoftPaytm (One97 Communications Limited)

Given N pairs of parentheses, write a function to generate and print all combinations of well-formed parentheses. That is, you need to generate all possible valid sets of parentheses that can be formed with a given number of pairs.

Problem approach

For adding (: If number of opening brackets(open) is less than the the given length(n) i.e.
if maxFor adding ): If number of close brackets(close) is less than the opening brackets(open), i.e.
if open

Try solving now
02
Round
Hard
Video Call
Duration75 mins
Interview date24 Aug 2022
Coding problem2

This round was taken by a lead engineer with 7+ years of experience. This round was also taken on zoom with the motive to check coding ability.

1. Merge Intervals

Moderate
20m average time
80% success
0/80
Asked in companies
GoogleInnovaccerFacebook

You are given N number of intervals, where each interval contains two integers denoting the start time and the end time for the interval.

The task is to merge all the overlapping intervals and return the list of merged intervals sorted by increasing order of their start time.

Two intervals [A,B] and [C,D] are said to be overlapping with each other if there is at least one integer that is covered by both of them.

For example:

For the given 5 intervals - [1, 4], [3, 5], [6, 8], [10, 12], [8, 9].

Since intervals [1, 4] and [3, 5] overlap with each other, we will merge them into a single interval as [1, 5].

Similarly, [6, 8] and [8, 9] overlap, merge them into [6,9].

Interval [10, 12] does not overlap with any interval.

Final List after merging overlapping intervals: [1, 5], [6, 9], [10, 12].
Problem approach

Sort the intervals by their starting points. Then, we take the first interval and compare its end with the next interval starts. As long as they overlap, we update the end to be the max end of the overlapping intervals. Once we find a nonoverlapping interval, we can add the previous "extended" interval and start over.

Try solving now

2. LFU Cache

Moderate
0/80
Asked in companies
AmazonGartnerDisney + Hotstar

Design and implement a Least Frequently Used(LFU) Cache, to implement the following functions:

1. put(U__ID, value): Insert the value in the cache if the key(‘U__ID’) is not already present or update the value of the given key if the key is already present. When the cache reaches its capacity, it should invalidate the least frequently used item before inserting the new item.

2. get(U__ID): Return the value of the key(‘U__ID’),  present in the cache, if it’s present otherwise return -1.
Note:
  1) The frequency of use of an element is calculated by a number of operations with its ‘U_ID’ performed after it is inserted in the cache.

  2) If multiple elements have the least frequency then we remove the element which was least recently used. 

You have been given ‘M’ operations which you need to perform in the cache. Your task is to implement all the functions of the LFU cache.

Type 1: for put(key, value) operation.
Type 2: for get(key) operation.
Example:
We perform the following operations on an empty cache which has capacity 2:

When operation 1 2 3 is performed, the element with 'U_ID' 2 and value 3 is inserted in the cache.

When operation 1 2 1 is performed, the element with 'U_ID' 2’s value is updated to 1.  

When operation 2 2 is performed then the value of 'U_ID' 2 is returned i.e. 1.

When operation 2 1 is performed then the value of 'U_ID' 1 is to be returned but it is not present in cache therefore -1 is returned.

When operation 1 1 5 is performed, the element with 'U_ID' 1 and value 5 is inserted in the cache. 

When operation 1 6 4 is performed, the cache is full so we need to delete an element. First, we check the number of times each element is used. Element with 'U_ID' 2 is used 3 times (2 times operation of type 1 and 1-time operation of type 1). Element with 'U_ID' 1 is used 1 time (1-time operation of type 1). So element with 'U_ID' 1 is deleted. The element with 'U_ID' 6 and value 4 is inserted in the cache. 
Problem approach

Similar to bucket sort, we place key, value pairs with the same frequency into the same bucket, within each bucket, the pairs are sorted according to most recent used, i.e., the one that is most recently used (set,get) is at the bottom of each bucket.

Try solving now
03
Round
Easy
Video Call
Duration60 mins
Interview date24 Aug 2022
Coding problem1

This round was taken by an Engineering Manager at Hotstar. He Introduced himself and was an EX- Amazon Engineer worked on various startups His main focus was on my internship Projects and the tech stack used followed by 1 DSA question.

1. Reverse Nodes in k-Group

Hard
56m average time
30% success
0/120
Asked in companies
WalmartSAP LabsHike

You are given a Singly Linked List of integers and an integer array 'B' of size 'N'. Each element in the array 'B' represents a block size. Modify the linked list by reversing the nodes in each block whose sizes are given by the array 'B'.

Note:
1. If you encounter a situation when 'B[i]' is greater than the number of remaining nodes in the list, then simply reverse the remaining nodes as a block and ignore all the block sizes from 'B[i]'. 

2. All block sizes are contiguous i.e. suppose that block 'B[i]' ends at a node cur, then the block 'B[i+1]' starts from the node just after the node cur.
Example
Linked list: 1->2->3->4->5
Array B: 3 3 5

Output: 3->2->1->5->4

We reverse the first block of size 3 and then move to block 2. Now, since the number of nodes remaining in the list (2) is less than the block size (3), we reverse the remaining nodes (4 and 5) as a block and ignore all the block sizes that follow.
Problem approach

The first part of this problem reverse() can be done using pretty much the [Easy] Reverse Linked List algorithm. But instead of reversing it all, this time we're just interested in K length, so reverse(head, length).

The second part of this problem consists in iterating (making sure K group can be done) and attaching the reversed parts.

Try solving now

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

One of the following is a selection statement, Which is it?

Choose another skill to practice
Start a Discussion
Similar interview experiences
SDE - 1
3 rounds | 5 problems
Interviewed by Disney + Hotstar
0 views
2 comments
0 upvotes
SDE - 1
2 rounds | 4 problems
Interviewed by Disney + Hotstar
542 views
0 comments
0 upvotes
SDE - 1
3 rounds | 5 problems
Interviewed by Disney + Hotstar
396 views
0 comments
0 upvotes
SDE - 1
3 rounds | 6 problems
Interviewed by Disney + Hotstar
471 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
105442 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
50321 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
31332 views
6 comments
0 upvotes