Tip 1: Practice programming questions daily.
Tip 2: Do not jump into code directly. Brainstorm ideas and arrive at a solution.
Tip 3: Learn OOP, real-world scenarios, DBMS, OS, and CN.
Tip 1: Highlight your achievements: Instead of just listing your job duties, focus on your accomplishments and how you added value to your previous employers.
Tip 2: Customize it for the job: Tailor your resume to match the job description and requirements. Highlight the skills and experience that are most relevant to the job you are applying for.
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.
Initialize two variables, largest and second_largest, both set to negative infinity.
Iterate through the array:
a. If the current element is greater than the largest value, update second_largest to hold the previous value of largest, and update largest with the current element.
b. If the current element is greater than the second_largest value but smaller than the largest, update second_largest with the current element.
After iterating through the array, the second_largest variable will hold the second largest element.
Return the value of second_largest.
If the given array is [1,2,3] then the answer would be 2. One of the ways to make all the elements of the given array equal is by adding 1 to the array element with value 1 and subtracting 1 from the array element with value 3. So that final array would become [2,2,2].
The series is 1-based indexed.
I solved the problem using the dynamic programming concept, creating a 1-D array and using the previous two values to calculate the next final leading to the final result.
Tip 1 : Good knowledge of DBMS and SQL will help you clear this kind of questions
Introduce yourself
Why do you want to join the company?
What do you know about the company?
What is the most difficult decision you had to make and how did you make it?
A situation that frustrated you and how did you deal with it?
When did you feel a great sense of achievement and why?
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?