Expedia SDE-1 Gurgaon — 2 coding rounds (stocks, BST, arrays)
Round 1 (Coding and Problem solving round held on bluejeans)
http://collabedit.com/ was used for code sharing , the video and screen share were on throughout the interview
Question 1: Given an array of stock prices with index representing the days, return the maximum profit . The user can buy only once and sell only once. The buy and sell date cannot be same.
It is a similar leetcode question:
https://leetcode.com/problems/best-time-to-buy-and-sell-stock/
Question 2: Construct a stack with functions Push, Pop, and Min_value_in_stack (returns minimum value in stack at any point). Similar question on leetcode: https://leetcode.com/problems/min-stack/
Round 2(Coding and Data Structures Round)
Held on Bluejeans video call and code in http://collabedit.com/
Question : What is Binary Search Tree(BST)? Why is a given example not a BST? What are some applications of BST? Give order traversals (pre/in/post) of a tree.
Question : Given an array having numbers from 1 to n, where 2 numbers are missing, find the two missing numbers.
Question : Given a linked list with duplicate elements, sum up the consecutive duplicates and return the end result (do not use extra space like a map to store frequency). Example: 1->2->2->3->3->3->9 becomes 1->4->9.
The loop · 2 rounds
Best time to buy and sell stock; min-stack
BST theory & traversals; find two missing numbers in 1..n; sum consecutive duplicates in linked list without extra space