Only write those things in the resume which you are confident of and keep practising.
This is a written round on paper for everyone. 2 out of 3 must be correct covering every single edge cases to qualify for the next round and the only most optimal solution was to be considered.



Given an array arr of N integers. Find the contiguous sub-array with maximum sum.
Input:
The first line of input contains an integer T denoting the number of test cases. The description of T test cases follows. The first line of each test case contains a single integer N denoting the size of array. The second line contains N space-separated integers A1, A2, ..., AN denoting the elements of the array.
Output:
Print the maximum sum of the contiguous sub-array in a separate line for each test case.
Constraints:
1 ≤ T ≤ 110
1 ≤ N ≤ 106
-107 ≤ A[i] <= 107
Example:
Input
2
5
1 2 3 -2 5
4
-1 -2 -3 -4
Output
9
-1
I used Kadane algorithm to solve this question. And wrote a clean code with handling of negative numbers also.



There are given N ropes of different lengths, we need to connect these ropes into one rope. The cost to connect two ropes is equal to sum of their lengths. The task is to connect the ropes with minimum cost.
Input:
The first line of input contains an integer T denoting the number of test cases. The first line of each test case is N where N is the number of ropes. The second line of each test case contains N input L[i],length of ropes.
Output:
For each testcase, print the minimum cost to connect all the ropes.
Constraints:
1 ≤ T ≤ 100
1 ≤ N ≤ 106
1 ≤ L[i] ≤ 106
Example:
Input:
2
4
4 3 2 6
5
4 2 7 6 9
Output:
29
62
I solved this question using priority queue by inserting all elements in priority queue and then taking maximum two out of them and pushing their sum again to priority queue.



Given a Binary Tree, print Left view of it. Left view of a Binary Tree is set of nodes visible when tree is visited from Left side. The task is to complete the function leftView(), which accepts root of the tree as argument.
Left view of following tree is 1 2 4 8.
1
/ \
2 3
/ \ / \
4 5 6 7
\
8
Example 1:
Input:
1
/ \
3 2
Output: 1 3
Example 2:
Input:

Output: 10 20 40
This was again very standard question and solved it using recursion.
Print all three nodes in a binary tree such that sum of all these three nodes is greater than given x and these three nodes must hold the relationship of grandparent-parent-child. Expected Complexity – O(n)
I thought of recursion approach of preorder and then tried storing elements in a stack but could not solve this question. Then the interviewer moved to the next question.



Stickler the thief wants to loot money from a society having n houses in a single line. He is a weird person and follows a certain rule when looting the houses. According to the rule, he will never loot two consecutive houses. At the same time, he wants to maximize the amount he loots. The thief knows which house has what amount of money but is unable to come up with an optimal looting strategy. He asks for your help to find the maximum money he can get if he strictly follows the rule. Each house has a[i] amount of money present in it.
Input:
The first line of input contains an integer T denoting the number of test cases. T testcases follow. Each test case contains an integer n which denotes the number of houses. Next line contains space separated numbers denoting the amount of money in each house.
Output:
For each testcase, in a newline, print an integer which denotes the maximum amount he can take home.
Constraints:
1 <= T <= 200
1 <= n <= 104
1 <= a[i] <= 104
Example:
Input:
2
6
5 5 10 100 10 5
3
1 2 3
Output:
110
4
I told interviewer dynamic programming based on include current element to current sum or exclude that element and he asked me to write its code and I gave properly commented code for this.
Tell me about yourself.
I gave him my basic introduction with previous experience and skills.
Why are looking for a change, you recently joined a company and now again you are giving interviews.
I simply gave the reason that amazon is better than my previous company so wanted to join it.
Mutex vs Semaphores with a real-life example.
Gave him a proper definition of both and then gave him an example based on classical OS problems.
Normalization and why it is done?
Gave him a basic definition and real-life example of a database of the store.
Rest API.
I told him the definition of REST and then explained it through an example of my project in which REST API was used.
Rabbit MQ and Kafka.
I didn’t know anything about them so could not tell it to the interviewer.
Write a shell script to parse a log file.
I didn’t mention anything like Rabbit MQ, Kafka, database in my resume but still he kept asking me these questions. I mentioned that I am familiar with the shell scripting in my resume but could not able to write the script as I didn’t remember the syntax and that’s a learning for me that don’t mention anything about anything if you are not very good about it.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
How do you remove whitespace from the start of a string?