Tip 1: Make interactive projects based on full-stack development.
Tip 2: Practice at least 250 questions of DSA
Tip 3: Do not write anything that you are not confident of in your resume
Tip 1: Make your resume short and crisp.
Tip 2: Do not put false things on your resume
Tip 3: Don't put irrelevant information on the resume
There were 3-4 coding questions, out of which 2 were of easy-medium difficulty level, and 1 was of medium level.



Given the arrival and departure times of all trains that reach a railway station, the task is to find the minimum number of platforms required for the railway station so that no train waits. We are given two arrays that represent the arrival and departure times of trains that stop.
Store the arrival time and departure time and sort them based on arrival time then check if the arrival time of the next train is smaller than the departure time of the previous train if it is smaller then increment the number of the platforms needed otherwise not.
Store the arrival time and departure time in array arr and sort this array based on arrival time
Declare a priority queue(min-heap) and store the departure time of the first train also declare a counter cnt and initialize it with 1.
Iterate over arr from 1 to n-1
check if the arrival time of the current train is less than or equal to the departure time of the previous train which is kept on top of the priority queue
If true, then push the new departure time and increment the counter cnt
otherwise, we pop() the departure time
push new departure time in the priority queue
Finally, return the cnt.



Given a sorted and rotated array arr[] of size N and a key, the task is to find the key in the array.
The idea is to find the pivot point, divide the array into two sub-arrays, and perform a binary search.
The main idea for finding a pivot is –
For a sorted (in increasing order) and rotated array, the pivot element is the only element for which the next element to it is smaller than it.
Using a binary search based on the above idea, a pivot can be found.
It can be observed that for a search space of indices in the range [l, r] where the middle index is mid,
If rotation has happened in the left half, then obviously the element at l will be greater than the one at mid.
Otherwise, the left half will be sorted but the element at mid will be greater than the one at r.
After the pivot is found divide the array into two sub-arrays.
Now the individual sub-arrays are sorted so the element can be searched using Binary Search.



Given an array of positive and negative numbers, the task is to find if there is a subarray (of size at least one) with 0 sum.
The idea is to iterate through the array and for every element arr[i], calculate the sum of elements from 0 to i (this can be done as sum += arr[i]). If the current sum has been seen before, there must be a zero-sum subarray. Hashing is used to store the sum values so that the sum can be stored quickly and find out whether the current sum is seen before or not.
Follow the given steps to solve the problem:
1) Declare a variable sum, to store the sum of prefix elements
2) Traverse the array and at each index, add the element into the sum and check if this sum exists earlier. If the sum exists, then return true
3) Also, insert every prefix sum into a map, so that later on it can be found whether the current sum is seen before or not
4) At the end return false, as no such subarray is found



Given a sorted array of positive integers, rearrange the array alternately i.e. first element should be a maximum value, at the second position minimum value, at the third position second max, at the fourth position second min, and so on.
The idea is to use an auxiliary array. We maintain two pointers one to the leftmost or smallest element and the other to the rightmost or largest element. Move both pointers toward each other and alternatively copy elements at these pointers to an auxiliary array. Finally, Copy the auxiliary array back to the original array.
When a pop() operation is called on an empty queue, what is the condition called? (Link)
What is the maximum number of swaps that can be performed in the Selection Sort algorithm?
Ans:- n-1
What does a foreign key combined with a primary key create? (Link)
Ans:- Network model between the tables that connect them
What will be the output of the following code snippet?
void solve() {
int a[] = {1, 2, 3, 4, 5};
int sum = 0;
for(int i = 0; i < 5; i++) {
if(i % 2 == 0) {
sum += a[i];
}
}
cout << sum << endl;
}
The interviewer asked coding questions and questions from my resume.



Write a program to check if a sentence is a palindrome or not. You can ignore white spaces and other characters to consider sentences as a palindrome.
1) Convert all the letters in a sentence to lowercase.
2) Use String.erase() method on the sentence to erase the white space in between the sentences.
3) Use the reverse method to reverse the sentence.
4) Checked the sentence reversed the sentence and returned the result.



Given an array coins[] of size N and a target value V, where coins[i] represent the coins of different denominations. You have an infinite supply of each of the coins. The task is to find the minimum number of coins required to make the given value V. If it’s not possible to make a change, print -1.
The idea is to find the Number of ways of Denominations By using the Top Down (memorization).
Algorithm:
Creating a 2-D vector to store the Overlapping Solutions
Keep Track of the overlapping subproblems while Traversing the array coins[]
Recall them whenever needed.
How to create components in ReactJS? (Link)
What are payloads in RESTful web services? (Link)
Explain ‘Addressing’ in RESTful web services.
What is the time complexity of quick sort? (Link)



Given an unsorted Linked List, the task is to remove duplicates from the list. Tell me only the logic of this question
1) Traverse the link list from head to end.
2) For every newly encountered element, check whether it is in the hash table:
if yes, remove it
otherwise put it in the hash table.
3) At the end, the Hash table will contain only the unique elements.

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