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 explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more.
This online coding round was conducted on Hackerrank.
It consisted of 10 MCQ questions with 20 minutes time and 3 coding questions with 15 + 20 + 30 minutes time.
It's pretty straight forward.
Step 1 : Just sort the 2d array on the basis of the 1st index
Step 2 : Keep track of our truck size and compute the answer.
static bool comp(vector& a, vector& b){
return a[1] > b[1];
}
int maximumUnits(vector>& arr, int x) {
sort(arr.begin(), arr.end(), comp);
int ans = 0, n = arr.size();
for(int i=0;i<n; i++)
{
if(x - arr[i][0] < 0){
int left_size = x;
ans += x * arr[i][1];
return ans;
}
else
{
ans += (arr[i][0] * arr[i][1]);
x -= arr[i][0];
}
}
return ans;
}
Input: 'prices' = [1, 2, 3] and 'fee' = 1
Output: 1
Explanation: We can generate the maximum profit of 1 by buying the stock on the first day for price = 1 and then selling it on the third day for price = 3.
The profit will be: 3 - 1 - 1(transaction fee) = 1
This is a classic DP problem.
Step1 : Traverse the whole array with the difference of each day.
Step2 : Check the profit by subtracting the price of each day including transaction fee.
Step3 : Trace the maximum profit and store the diff_days on which we are getting the maximum profit.
Step4 : Repeat the above steps until the loop terminates.
You can use any string of A multiple times.
A =[“coding”, ”ninjas”, “is”, “awesome”] target = “codingninjas”
Ans = true as we use “coding” and “ninjas” to form “codingninjas”
Step1 : (Recursive) For the string s, make a cut at each index and check if the substring 0 to cut is present in the dictionary
If it is then make the call to check for the remaining string
Step2 : (Memoise ) Use dp to store answer for current string
unordered_set dict;
unordered_map dp;
bool wordBreak_(string &s)
{
if (dp.find(s) != dp.end())
return dp[s];
// check if current string itself is in the dictionary
if (dict.find(s) != dict.end())
return dp[s] = true;
for (int i = 1; i < s.size(); i++)
{
// check substring from 1 to i of current string is in the dictionary
if (dict.find(s.substr(0, i)) != dict.end())
{
string remStr = s.substr(i);
// if the substring is present in dictionary, check for the remaining string
if (wordBreak_(remStr))
return dp[s] = true;
}
}
return dp[s] = false;
}
bool wordBreak(string &s, vector &wordDict)
{
// put all words into a hashset, to make find operation O(1)
for (string &str : wordDict)
dict.insert(str);
return wordBreak_(s);
}
3 coding problems related to Linked Lists of Easy to Medium level of difficulty were asked in this round
Input:
'num1' : 1 -> 2 -> 3 -> NULL
'num2' : 4 -> 5 -> 6 -> NULL
Output: 5 -> 7 -> 9 -> NULL
Explanation: 'num1' represents the number 321 and 'num2' represents 654. Their sum is 975.
A doubly linked list is a kind of linked list that is bidirectional, meaning it can be traversed in both forward and backward directions.
Input:
4
4 3 2 1
This means you have been given doubly linked list of size 4 = 4 <-> 3 <-> 2 <-> 1.
Output:
1 2 3 4
This means after reversing the doubly linked list it becomes 1 <-> 2 <-> 3 <-> 4.
This was a typical HR round with some standard Behavioral questions.
Why should we hire you?
Tip 1 : The cross-questioning can go intense sometimes, think before you speak.
Tip 2 : Be open-minded and answer whatever you are thinking in these rounds, I feel it is important to have an opinion.
Tip 3 : Since everybody in the interview panel is from a tech background, here too you can expect some technical questions. No coding in most of the cases but some discussions over the design can surely happen.
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?