Tip 1: Prepare some Projects
Tip 2: Practice At least 250 Questions of DS algo
Tip 3: Do at least two application based projects
Tip 1 : add some application based projects in your resume.
Tip 2 : Do not put false things on resume.
3 coding questions to be solved in 3 hours



If “nums” = {2, 1, 3}.
The valid non-empty subsequences of the array are {2}, {1}, {3}, {2, 1}, {1, 3}, {2, 3} and {2, 1, 3}. So, the longest subsequence satisfying the given conditions are {2, 1} and {2, 3}. The length of the longest subsequence is 2. So, the answer is 2.
Any subsequence of length = 1 is also a valid subsequence.


You can’t sell without buying first.
For the given array [ 2, 100, 150, 120],
The maximum profit can be achieved by buying the stock at minute 0 when its price is Rs. 2 and selling it at minute 2 when its price is Rs. 150.
So, the output will be 148.
class Solution:
def maxProfit(self,prices):
left = 0 #Buy
right = 1 #Sell
max_profit = 0
while right < len(prices):
currentProfit = prices[right] - prices[left] #our current Profit
if prices[left] < prices[right]:
max_profit =max(currentProfit,max_profit)
else:
left = right
right += 1
return max_profit


1. The element at index 0 in the new ‘ARR’ is 3 because ‘ARR[0]’ ^ ‘ARR[1]’ is 1 ^ 2 which is equal to 3.
2. The element at index 1 in the new ‘ARR’ is 1 because ‘ARR[1]’ ^ ‘ARR[2]’ is 2 ^ 3 which is equal to 1.
3. The element at index 2 in the new ‘ARR’ is 7 because ‘ARR[2]’ ^ ‘ARR[3]’ is 3 ^ 4 which is equal to 7.
4. The element at index 3 in the new ‘ARR’ is 1 because ‘ARR[3]’ ^ ‘ARR[4]’ is 4 ^ 5 which is equal to 1.
5. The element at index 4 in the new ‘ARR’ is 5 because there is no element in the right of ‘ARR[4]’ so it will remain as it is in the new ‘ARR’.
As Ninja is busy with some other task, so he asks you for help. Can you help Ninja to reconstruct the ‘ARR’?



In the given linked list, there is a cycle, hence we return true.

What is the time Complexity of binary search? (Learn)
Ans:- nlog(n)
What are Wrapper classes? (Learn)
A wrapper class wraps primitive data types like (int, char, etc.,) which can then be used as objects.
What is the difference between TCP and UDP protocols? Which is the better one among these? (Learn)
The main difference between TCP (transmission control protocol) and UDP (user datagram protocol) is that TCP is a connection-based protocol and UDP is connectionless. While TCP is more reliable, it transfers data more slowly. UDP is less reliable but works more quickly.



a) Duplicate elements may be present.
b) If no such element is present return -1.
Input: Given a sequence of five numbers 2, 4, 5, 6, 8.
Output: 6
Explanation:
In the given sequence of numbers, number 8 is the largest element, followed by number 6 which is the second-largest element. Hence we return number 6 which is the second-largest element in the sequence.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
To make an AI less repetitive in a long paragraph, you should increase: