Tip 1 : Must do Previously asked Interview as well as Online Test Questions.
Tip 2 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 3 : Do at-least 2 good projects and you must know every bit of them.
Tip 1 : Have at-least 2 good projects explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more.
Hello everyone! Expedia came to our campus for full time hiring of final year students. They had shortlisted candidates for the interviews by taking an online test comprised of four sections (Quantitative, C, Logical and English). Every section had a timer attached to it, so you need to think and answer quickly. Although, the questions were easy but cutoff was quite high. This round was followed by a coding round, comprised of two questions.



This is a visualization of the Circular Linked List, represented by:
1 2 3 4 5 -1

The Circular Linked List before/after deletion may happen to be empty. In that case, only print -1.
All integers in the list are unique.
The idea is to use a recursive approach to find the given key and then remove that node. The recursive idea is very clear that we will traverse through the circular linked list, and we will check if the value of the node is equal to the given key.
We will define a function deleteNodeHelper(root, key, head) to remove the key in which the head is the starting node of the linked list, and we will send root as the next node of the head node.
Working of the Recursive function:



'N' = 7, 'C' = 4, pages = [1, 2, 1, 4, 2, 3, 5].
For the first four pages, memory allocated with four pages, {1, 2, 1, 4}, page fault = 3.
For fifth, page number 2 is required, which is already present, page fault = 3.
Then, page number 3 is required, replaces LRU 2, page fault = 4.
Then, page number 5 is required, replaces LRU 1, page fault = 5.
The total page fault is 5.
Approach: According to LRU, if the page we need is not present in the set of pages, the page fault occurs, and we replace the least recently used page with the current page. And if the page is present, we just use it, and no page fault occurs.
Algorithm:
The man who was taking my first round was my alumni. He started-off by asking my introduction and then gave me 2 programming questions to code. He then navigated on to my Codechef profile and asked a question that I did in the June 14 Long Contest. I explained him and he was satisfied.
Tips : You don’t have to answer the stuffs quickly, rather you need to develop some test cases and have some discussion regarding the structure of the problem, and then answer.



In the given linked list, there is a cycle, hence we return true.

Floyd's algorithm can be used to solve this question.
Define two pointers slow and fast. Both point to the head node, fast is twice as fast as slow. There will be no cycle if it reaches the end. Otherwise, it will eventually catch up to the slow pointer somewhere in the cycle.
Let X be the distance from the first node to the node where the cycle begins, and let X+Y be the distance the slow pointer travels. To catch up, the fast pointer must travel 2X + 2Y. L is the cycle size. The total distance that the fast pointer has travelled over the slow pointer at the meeting point is what we call the full cycle.
X+Y+L = 2X+2Y
L=X+Y
Based on our calculation, slow pointer had already traveled one full cycle when it met fast pointer, and since it had originally travelled A before the cycle began, it had to travel A to reach the cycle's beginning!
After the two pointers meet, fast pointer can be made to point to head. And both slow and fast pointers are moved till they meet at a node. The node at which both the pointers meet is the beginning of the loop.
Pseudocode :
detectCycle(Node *head) {
Node *slow=head,*fast=head;
while(slow!=NULL && fast!=NULL && fast->next!=NULL) {
slow = slow->next;
fast = fast->next->next;
if(slow==fast)
{
fast = head;
while(slow!=fast)
{
slow = slow->next;
fast=fast->next;
}
return slow;
}
}
return NULL; }



In the case of two closest sums, print the smallest sum.
Concept of sorting can be applied here.
1. Sort the array.
2. Maintain two indexes one at beginning (l=0) and one at end (r=n-1).
3. Now, traverse the array until l 3.1 Calculate sum of arr[l] + arr[r]
3.2 if abs (sum) < abs (minimum sum), then update the minimum sum and pair.
3.3 If sum < 0, this means if we want to find sum close to 0, do l++
3.4 If sum is greater than 0,this means if we want to find sum close to 0 , do r--.
The minimum sum will store the sum closest to zero.
Time Complexity : O(nlogn)
HR interview that lasted for 30 minutes. The interviewer asked me questions to know more about me.
Tip : The whole process is quite lengthy and one needs to have a sound sleep before interview. Moreover, you need to be more than technical in order to crack Expedia.

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?