1. Tip 1: It is better to mention one of your projects than to mention four projects copied from other sites.
2. Tip 2: Be patient with your progress. Take your time with different technologies.
3. Tip 3: Always go through recent interview experiences for the company for which you are giving the interview.
Tip 1: Always update your resume according to the job description. Add and remove things accordingly.



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.
First I go with the basic approach of sorting the array and printing the 2nd last element. This will take nlogn time .
After that I thought of another approach of doing this in o(n) time - For that I find the largest element from array and then again find the largest element excluding the previous element.



Infix notation is a method of writing mathematical expressions in which operators are placed between operands. For example, "a + b" represents the addition of a and b.
Prefix notation is a method of writing mathematical expressions in which operators are placed before the operands. For example, "+ a b" represents the addition of a and b.
Expression contains lowercase English letters, ‘+’, ‘-’, ‘*’, and ‘/’.
Input: /-ab+-cde
Output: ((a-b)/((c-d)+e))
Explanation:
In this test case, there are four operators ‘/’, ‘-’, ‘+’, ‘-’.
Prefix expression: /-ab+-cde.
The operator between ‘a’ and ‘b’ is ‘-’. Resulting expression: /(a-b)+-cde.
The operator between ‘c’ and ‘d’ is ‘-’. Resulting expression: /(a-b)+(c-d)e.
The operator between ‘c-d’ and ‘e’ is +. Resulting expression: /(a-b)((c-d)+e).
The operator between ‘a-b’ and ‘((c-d)+e)’ is ‘/’. Resulting expression: ((a-b)/((c-d)+e)).
Read the Prefix expression in reverse order (from right to left)
If the symbol is an operand, then push it onto the Stack
If the symbol is an operator, then pop two operands from the Stack
Create a string by concatenating the two operands and the operator between them.
And push the resultant string back to Stack
Repeat the above steps until the end of Prefix expression.



Input: 'arr' = [1, 2, 7, -4, 3, 2, -10, 9, 1]
Output: 11
Explanation: The subarray yielding the maximum sum is [1, 2, 7, -4, 3, 2].
First of all ask your doubts and get good understanding of question. like which type of element can array contains.
Initialize:
max_so_far = INT_MIN
max_ending_here = 0
Loop for each element of the array
(a) max_ending_here = max_ending_here + a[i]
(b) if(max_so_far < max_ending_here)
max_so_far = max_ending_here
(c) if(max_ending_here < 0)
max_ending_here = 0
return max_so_far



Input: str1 = “ab” , str2 = “aoba”
Output: Yes
Explanation: Permutations of first-string str1 i.e. “ab” are [“ab”, “ba”].
The substrings of str2, i.e. “aoba” are [“a”, “o”, “b”, “a”, “ao”, “ob”, “ba”, “aob”, “oba”, “aoba”].
The string “ba” is present in the list of substrings of string str2.
Create a function permute() with parameters as input string, starting index of the string, ending index of the string
Call this function with values input string, 0, size of string – 1
In this function, if the value of L and R is the same then print the same string
Else run a for loop from L to R and swap the current element in the for loop with the inputString[L]
Then again call this same function by increasing the value of L by 1
After that again swap the previously swapped values to initiate backtracking
SQL query to get second largest salary of an employee from employee table. (Practice)
In this round Interviewer has asked me some output related questions, puzzles, SQL queries and test cases.
You have got someone working for you for five days and a gold bar to pay him. You must give them a piece of gold at the end of every day. What are the fewest number of cuts to the bar of gold that will allow you to pay him 1/5th each day. (Practice)
Cut it into [1/5,2/5,2/5] or [1/5,1/5,3/5]. Minimum cuts is 2 in both cases.
Suppose that we wish to know which stories in a 100-storey building are safe to drop eggs from, and which will cause the eggs to break on landing. What strategy should be used to drop eggs such that a total number of drops in the worst case is minimized and we find the required floor? (Practice)
A person has 3000 bananas and a camel. The person wants to transport the maximum number of bananas to a destination which is 1000 KMs away, using only the camel as a mode of transportation. The camel cannot carry more than 1000 bananas at a time and eats a banana every km it travels. What is the maximum number of bananas that can be transferred to the destination using only camel (no other mode of transportation is allowed). (Practice)
Write an SQL query to report all the duplicate emails. You can return the result table in any order. (Practice)
You have a birthday cake and have to cut it into 8 equal pieces by making 3 cuts only. How do you do it? (Practice)

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?