Tip 1 : Basic of DSA should be clear, think out loud
Tip 2 : Dry the code
Tip 3 : Cover all test cases
Tip 1: Mention at least 2 project
Tip 2: Do add too many extracurricular activities
It was at 12 pm and a proctored exam.


The width of each bar is the same and is equal to 1.
Input: ‘n’ = 6, ‘arr’ = [3, 0, 0, 2, 0, 4].
Output: 10
Explanation: Refer to the image for better comprehension:

You don't need to print anything. It has already been taken care of. Just implement the given function.



A connected component in the map is the maximum subset of cities that are connected i.e we can go from one city to any other in that subset.
it was at 11 am, with video on



For a (6 x 6) board, the numbers are written as follows:

You start from square 1 of the board (which is always in the last row and first column). On each square say 'X', you can throw a dice which can have six outcomes and you have total control over the outcome of dice throw and you want to find out the minimum number of throws required to reach the last cell.
Some of the squares contain Snakes and Ladders, and these are possibilities of a throw at square 'X':
You choose a destination square 'S' with number 'X+1', 'X+2', 'X+3', 'X+4', 'X+5', or 'X+6', provided this number is <= N*N.
If 'S' has a snake or ladder, you move to the destination of that snake or ladder. Otherwise, you move to S.
A board square on row 'i' and column 'j' has a "Snake or Ladder" if board[i][j] != -1. The destination of that snake or ladder is board[i][j].
You can only take a snake or ladder at most once per move: if the destination to a snake or ladder is the start of another snake or ladder, you do not continue moving - you have to ignore the snake or ladder present on that square.
For example, if the board is:
-1 1 -1
-1 -1 9
-1 4 -1
Let's say on the first move your destination square is 2 [at row 2, column 1], then you finish your first move at 4 [at row 1, column 2] because you do not continue moving to 9 [at row 0, column 0] by taking the ladder from 4.
A square can also have a Snake or Ladder which will end at the same cell.
For example, if the board is:
-1 3 -1
-1 5 -1
-1 -1 9
Here we can see Snake/Ladder on square 5 [at row 1, column 1] will end on the same square 5.



If a particular job has a deadline 'x', it means that it needs to be completed at any time before 'x'.
Assume that the start time is 0.
'N' = 3, Jobs = [[1, 1, 30], [2, 3, 40], [3, 2, 10]].
All the jobs have different deadlines. So we can complete all the jobs.
At time 0-1, Job 1 will complete.
At time 1-2, Job 3 will complete.
At time 2-3, Job 2 will complete.
So our answer is [3 80].
it was 5 pm, with video on
Design DBMS for campaigns and notification system for magicpin
Tip 1: Write and visualise everything
Tip 2: Keep discussing

The graph has no self-edges, no parallel edges.
The graph may not be connected.
If ‘N’ = 7, ‘M’ = 5, ‘SOURCE’ = 1, ‘DESTINATION’ = 5, EDGES = [ [2, 4], [2, 5],[3, 5],[3, 6],[4, 5] ].

Here, you can see that the graph is not connected and there is no way we can reach node 5 from node 1 as they both are in different connected components. Hence, the output is “No”.
There are 3 jars, namely, A, B, C. All of them are mislabeled. Following are the labels of each of the jars:
A: Candies
B: Sweets
C: Candies and Sweets (mixed in a random proportion)
You can put your hand in a jar and pick only one eatable at a time. Tell the minimum number of eatable(s) that has/have to be picked in order to label the jars correctly.
100 people standing in a circle in an order 1 to 100. No. 1 has a sword. He kills the next person (i.e. No. 2) and gives the sword to the next (i.e. No. 3). All people do the same until only 1 survives. Which number survives at the last?
There are 100 people starting from 1 to 100.
It was 2 pm, with video on
1. why magicpin
2. tell me about yourself
3. how HTTP requests are routed
4. diff between post,get and put calls
5. internship and projects
Tip 1: Talk openly
Tip 2: practice such questions while preparing

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What is recursion?