Tip 1: Practice at least 300 questions.
Tip 2: Build your resume according to the job description.
Tip 3: Working with big data/distributed systems is a plus.
Tip 1: Skills relevant to the job description.
Tip 2: Do not include false information on your resume; ensure in-depth knowledge of everything listed.
This was a Data Structures round. Both questions were answered with optimal time complexity and clean code. Every other question was answered to the best of my knowledge.



1. The grid has 0-based indexing.
2. A rotten orange can affect the adjacent oranges 4 directionally i.e. Up, Down, Left, Right.
To solve this, we will follow these steps:
While true (i.e., while there are still fresh cells), do the following:
For i := 0, while i < rowMax, increment i by 1, do the following:
For j := 0, while j < colMax, increment j by 1, do the following:
If newGrid[i, j] == 1, then:
If flag is true, then increment minutes by 1.
Otherwise, exit the loop.
Return:



For the given input array [1, 1, 3],
1 can be represented as the sum of elements of the subset [1],
2 can be represented as the sum of elements of a subset [1, 1],
3 can be represented as the sum of elements of a subset [3],
4 can be represented as the sum of elements of a subset [1, 3],
5 can be represented as the sum of elements of a subset [1, 1, 3]
So, the smallest positive integer value that cannot be represented as a sum of elements of any subset of a given array is 6.
Solved using Segment tree implementation.



The traversal should proceed from left to right according to the input adjacency list.
Adjacency list: { {1,2,3},{4}, {5}, {},{},{}}
The interpretation of this adjacency list is as follows:
Vertex 0 has directed edges towards vertices 1, 2, and 3.
Vertex 1 has a directed edge towards vertex 4.
Vertex 2 has a directed edge towards vertex 5.
Vertices 3, 4, and 5 have no outgoing edges.
We can also see this in the diagram below.
BFS traversal: 0 1 2 3 4 5

Complete BFS implementation.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
How do you remove whitespace from the start of a string?