Tip 1 : try to complete the medium code in 30 mins of durations.
Tip 2 : Prepare one coding language in which you are more comfortable with.
Tip 3 : Practice daily on CodeStudio.
Tip 1 : Have some projects on your resume.
Tip 2 : Never put false things.



You are given a non-empty binary tree where every node has positive val. ret the max possible path sum b/w any two leaves of the given tree.
If there is single node in the tree, then return negative one.
The path is also inclusive of the leaf nodes and the max path sum may or may not go through the root of the given tree.



You are given a network of n nodes, labeled from 1 to n. You are also given times, a list of travel times as directed edges times[i] = (ui, vi, wi), where ui is the source node, vi is the target node, and wi is the time it takes for a signal to travel from source to target.We will send a signal from a given node k. Return the minimum time it takes for all the n nodes to receive the signal. If it is impossible for all the n nodes to receive the signal, return -1.
I think bfs and Dijkstra are very similar problems. It's just that Dijkstra cost is different compared with bfs, so use priorityQueue instead a Queue for a standard bfs search.
2. OS Question
In priority scheduling algorithm ____________
a) CPU is allocated to the process with the highest priority
b) CPU is allocated to the process with the lowest priority
c) Equal priority processes can not be scheduled
d) None of the mentioned
3. OS Question
To avoid deadlock ____________
a) there must be a fixed number of resources to allocate
b) resource allocation must be done only once
c) all deadlocked processes must be aborted
d) inversion technique can be used
1. DBMS Question
Which of the following is a command of DDL?
1) Alter
2) Delete
3) Create
4) All of the Above



Given an array/list of integer numbers 'CHOCOLATES' of size 'N', where each value of the array/list represents the number of chocolates in the packet. There are ‘M’ number of students and the task is to distribute the chocolate to their students. Distribute chocolate in such a way that:1. Each student gets at least one packet of chocolate.2. The difference between the maximum number of chocolate in a packet and the minimum number of chocolate in a packet given to the students is minimum.
Example :
Given 'N' : 5 (number of packets) and 'M' : 3 (number of students)
And chocolates in each packet is : {8, 11, 7, 15, 2}
All possible way to distribute 5 packets of chocolates among 3 students are -
( 8,15, 7 ) difference of maximum-minimum is ‘15 - 7’ = ‘8’
( 8, 15, 2 ) difference of maximum-minimum is ‘15 - 2’ = ‘13’
( 8, 15, 11 ) difference of maximum-minimum is ‘15 - 8’ = ‘7’
( 8, 7, 2 ) difference of maximum-minimum is ‘8 - 2’ = ‘6’
( 8, 7, 11 ) difference of maximum-minimum is ‘11 - 7’ = ‘4’
( 8, 2, 11 ) difference of maximum-minimum is ‘11 - 2’ = ‘9’
( 15, 7, 2 ) difference of maximum-minimum is ‘15 - 2’ = 13’
( 15, 7, 11 ) difference of maximum-minimum is ‘15 - 7’ = ‘8’
( 15, 2, 11 ) difference of maximum-minimum is ‘15 - 2’ = ‘13’
( 7, 2, 11 ) difference of maximum-minimum is ‘11 - 2’ = ‘9’
Hence there are 10 possible ways to distribute ‘5’ packets of chocolate among the ‘3’ students and difference of combination (8, 7, 11) is ‘maximum - minimum’ = ‘11 - 7’ = ‘4’ is minimum in all of the above.



You are given a binary tree having 'n' nodes.The boundary nodes of a binary tree include the nodes from the left and right boundaries and the leaf nodes, each node considered once.Figure out the boundary nodes of this binary tree in an Anti-Clockwise direction starting from the root node.
Explanation: As shown in the figure
The nodes on the left boundary are [10, 5, 3]
The nodes on the right boundary are [10, 20, 25]
The leaf nodes are [3, 7, 18, 25].
Please note that nodes 3 and 25 appear in two places but are considered once.



An array arr is a mountain if the following properties hold:arr.length >= 3.
There exists some i with 0 < i < arr.length - 1 such that:arr[0] < arr[1] < ... < arr[i - 1] < arr[i] arr[i] > arr[i + 1] > ... > arr[arr.length - 1].
Given a mountain array arr, return the index i such that arr[0] < arr[1] < ... < arr[i - 1] < arr[i] > arr[i + 1] > ... > arr[arr.length - 1].
You must solve it in O(log(arr.length)) time complexity.
Binary Search - O(log(n)) time complexity
In each iteration, we check the mid: if it's smaller than the next element, it's on the left side of the mountain and we have to continue searching in the right side of mid. So low = mid+1. Otherwise, high = mid-1.

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