Tip 1: Understand the problem statement thoroughly and think from the brute-force approach, gradually optimizing your solution to the most efficient one.
Tip 2: Identify potential edge cases before coding your solution.
Tip 3: Aim for your code to run correctly on the first attempt, without any syntax errors or failing test cases.
Tip 1: Make your resume ATS-compatible.
Tip 2: Keep it short and limited to one page.
They asked a question on trees and expected me to write working code for it.

I used a simple DFS approach to solve the question.
They asked questions based on my resume and a simple DSA problem to solve.



1. There are no 2 adjacent elements having same value (as mentioned in the constraints).
2. Do not print anything, just return the index of the peak element (0 - indexed).
3. 'True'/'False' will be printed depending on whether your answer is correct or not.
Input: 'arr' = [1, 8, 1, 5, 3]
Output: 3
Explanation: There are two possible answers. Both 8 and 5 are peak elements, so the correct answers are their positions, 1 and 3.
// C++ program to find a peak element in the given array
// Using Binary Search
#include
#include
using namespace std;
int peakElement(vector &arr) {
int n = arr.size();
// If there is only one element, then it's a peak
if (n == 1)
return 0;
// Check if the first element is a peak
if (arr[0] > arr[1])
return 0;
// Check if the last element is a peak
if (arr[n - 1] > arr[n - 2])
return n - 1;
// Search Space for binary Search
int lo = 1, hi = n - 2;
while(lo <= hi) {
int mid = lo + (hi - lo)/2;
// If the element at mid is a
// peak element return mid
if(arr[mid] > arr[mid - 1]
&& arr[mid] > arr[mid + 1])
return mid;
// If next neighbor is greater, then peak
// element will exist in the right subarray
if(arr[mid] < arr[mid + 1])
lo = mid + 1;
// Otherwise, it will exist in left subarray
else
hi = mid - 1;
}
return 0;
}
int main() {
vector arr = {1, 2, 4, 5, 7, 8, 3};
cout << peakElement(arr);
return 0;
}
It was a managerial discussion, mostly focused on behavioural questions.
All the questions asked were behavioural. They inquired about my past work experiences and asked situational behavioural questions, such as when I last had to put in extra effort to deliver something to a customer. They also asked about my strengths and weaknesses, followed by a general discussion about the current team, the project, and my expected role and responsibilities.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What is recursion?