Disney + Hotstar interview experience Real time questions & tips from candidates to crack your interview

SDE - 1

Disney + Hotstar
upvote
share-icon
2 rounds | 4 Coding problems

Interview preparation journey

expand-icon
Journey
Being from a tier 3 college, I got no opportunities there. There was no coding culture in our college, so I ended up starting at a service-based company. After working for 2 years at the service-based company, I worked hard to get multiple offers and was selected by Microsoft from those.
Application story
There was an SDE-1 opening at Hotstar posted by employees working there, requiring 1+ year of experience. I reached out to an employee for a referral, received the test link, cleared it, and got the interview invites.
Why selected/rejected for the role?
Rejected. The HR did not reply after the second interview. I tried calling her, but to no avail; perhaps the opening was closed.
Preparation
Duration: 4 months
Topics: Data structures, Algorithms, OOPS, OS, DBMS, Computer Networks, System Design
Tip
Tip

Tip 1: Make sure your computer science fundamentals are very clear.
Tip 2: You should know the complexity of the code you write and understand the internal implementation of the data structures you use while coding.
Tip 3: You should know everything you write in your resume.
Tip 4: Practice a lot of programming problems and participate in competitive programming contests.

Application process
Where: Referral
Resume Tip
Resume tip

Tip 1: Be honest about what you write in your resume.
Tip 2: Include at least two projects.
Tip 3: Maintain a concise and self-explanatory one-page resume.
Tip 4: Highlight only your technical achievements.

Interview rounds

01
Round
Easy
Video Call
Duration60 minutes
Interview date20 Jan 2022
Coding problem2

This round was to test the coding ability of the candidate. He jumped straight to the coding questions on the HackerRank platform. He was extremely helpful throughout the interview.

1. Best Time to Buy and Sell Stock IV

Hard
20m average time
80% success
0/120
Asked in companies
AdobeRazorpayOYO

You have been given an array 'PRICES' consisting of 'N' integers where PRICES[i] denotes the price of a given stock on the i-th day. You are also given an integer 'K' denoting the number of possible transactions you can make.

Your task is to find the maximum profit in at most K transactions. A valid transaction involves buying a stock and then selling it.

Note
You can’t engage in multiple transactions simultaneously, i.e. you must sell the stock before rebuying it.
For Example
Input: N = 6 , PRICES = [3, 2, 6, 5, 0, 3] and K = 2.
Output: 7

Explanation : The optimal way to get maximum profit is to buy the stock on day 2(price = 2) and sell it on day 3(price = 6) and rebuy it on day 5(price = 0) and sell it on day 6(price = 3). The maximum profit will be (6 - 2) + (3 - 0) = 7.
Problem approach

We can find all adjacent valley/peak pairs and calculate the profits easily. Instead of accumulating all these profits like in Buy & Sell Stock II, we need the highest k profits.

The key point is when there are two v/p pairs (v1, p1) and (v2, p2), satisfying v1 <= v2 and p1 <= p2, we can either make one transaction at [v1, p2], or make two at both [v1, p1] and [v2, p2]. The trick is to treat [v1, p2] as the first transaction, and [v2, p1] as the second. Then we can guarantee the right max profits in both situations, p2 - v1 for one transaction and p1 - v1 + p2 - v2 for two.

Finding all v/p pairs and calculating the profits takes O(n) since there are up to n/2 such pairs. And extracting k maximums from the heap consumes another O(klgn).

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

Each key maps to the corresponding node (self._node), allowing us to retrieve the node in O(1) time.

Each frequency, freq, is mapped to a Doubly Linked List (self._freq), where all nodes in the DLinkedList share the same frequency, freq. Moreover, each node is always inserted at the head, indicating it is the most recently used.

A minimum frequency, self.minfreq, is maintained to track the minimum frequency across all nodes in this cache, ensuring that the DLinkedList with the minimum frequency can always be retrieved in O(1) time.

Try solving now
02
Round
Medium
Video Call
Duration60 minutes
Interview date28 Jan 2022
Coding problem2

This round was a mix of coding and system design. The interviewer was receptive, but I was not able to perform well in the system design question.

1. Jump Game

Moderate
15m average time
85% success
0/80
Asked in companies
Deutsche BankGoldman SachsAmazon

You have been given an array 'ARR' of ‘N’ integers. You have to return the minimum number of jumps needed to reach the last index of the array i.e ‘N - 1’.


From index ‘i’, we can jump to an index ‘i + k’ such that 1<= ‘k’ <= ARR[i] .


'ARR[i]' represents the maximum distance you can jump from the current index.


If it is not possible to reach the last index, return -1.


Note:
Consider 0-based indexing.
Example:
Consider the array 1, 2, 3, 4, 5, 6 
We can Jump from index 0 to index 1
Then we jump from index 1 to index 2
Then finally make a jump of 3 to reach index N-1

There is also another path where
We can Jump from index 0 to index 1
Then we jump from index 1 to index 3
Then finally make a jump of 2 to reach index N-1

So multiple paths may exist but we need to return the minimum number of jumps in a path to end which here is 3.
Problem approach

The idea is to work backward from the last index. Keep track of the smallest index that can "jump" to the last index. Check whether the current index can jump to this smallest index.

Try solving now

2. System Design

Design a Web Crawler.

Problem approach

Tip 1: Read articles on architecture and design.
Tip 2: Practice system design questions.
Tip 3: Talk through your thought process.

Here's your problem of the day

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

Skill covered: Programming

How do you remove whitespace from the start of a string?

Choose another skill to practice
Similar interview experiences
SDE - 1
3 rounds | 5 problems
Interviewed by Disney + Hotstar
0 views
2 comments
0 upvotes
SDE - 1
3 rounds | 5 problems
Interviewed by Disney + Hotstar
924 views
0 comments
0 upvotes
SDE - 1
3 rounds | 5 problems
Interviewed by Disney + Hotstar
700 views
0 comments
0 upvotes
SDE - 1
3 rounds | 6 problems
Interviewed by Disney + Hotstar
741 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
115096 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
58237 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
35146 views
7 comments
0 upvotes