Tip 1 : Must do Previously asked Interview as well as Online Test Questions.
Tip 2 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 3 : Do at-least 2 good projects and you must know every bit of them.
Tip 1 : Have at least 2 good projects mentioned in your resume with a link
Tip 2 : Focus on skills, internships, projects, and experiences.
Tip 3 : Make it simple, crisp, and one page
This was the online test taken on the mettl platform. There were 40 MCQs based on DSA, OOPs, DBMS, SQL and one coding question.
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.
The idea is to range over j from 0 to the length of prices where j is the sell price. Set i with the initial value 0. Anytime we reach a negative profit, notice it would have been better then to wait to buy until that point so we set i=j. We just keep track of the largest profit seen in the process.
import numpy as np
class Solution(object):
def maxProfit(self, prices):
"""
:type prices: List[int]
:rtype: int
"""
currentProfit = 0
maxProfit = 0
i=0
for j in range(len(prices)):
currentProfit = prices[j]-prices[i]
if currentProfit<0:
i=j
elif currentProfit>maxProfit:
maxProfit = currentProfit
return maxProfit
This was technical round based on DSA, networking and Operating system related questions.
If the given array is {1,5,2}, the returned array should be {1,5,3}.
Input array can contain leading zeros, but the output array should not contain any leading zeros (even if the input array contains leading zeroes).
For Example:
If the given array is {0,2}, the returned array should be {3}.
Solutions:
class Solution
{
public int[] plusOne(int[] digits)
{
int size= digits.length-1;
for(int i=size; i>-1; i--)
{
if(digits[i]<9)
{
digits[i]++;
return digits;
}
else {
digits[i]=0;
}
}
int result[]=new int[size+2];
result[0]=1;
return result;
}
}
This was technical + HR round taken by the senior Manager at HP having 10+ years of experience
Introduction
Why should we hire you ?
Explain Method Overloading and Method Overriding.
How would you rate yourself?
What three factors do you attribute to your success in life?
What are positive things in you?
Then he asked me to explain one of my projects. I had explained to him that project.
He asked me which one is a team project. I told him about one of my projects which was a team project.
Tip 1 : Make sure your resume is up-to-date
Tip 2 : Be confident and focus on your communication
Tip 3 : Prepare for the behavioural questions
Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
Which SQL keyword removes duplicate records from a result set?