Expedia Group
70+ Interview Questions and Answers
Write as you speak is a special sequence of strings that starts with string “1” and after one iteration you rewrite the sequence as whatever you speak.
Example :
The first few iterations of the seq...read more
Ninja is assigned a task to reach the last stone by his master. These stones are numbered with some value and in the form of an array. He is allowed to jump either odd-numbered jumps or even-numbere...read more
You are given an array consisting of 0s and 1s. You need to find the length of the largest subarray with an equal number of 0s and 1s.
For example:
If the given a...read more
You are given an array/list ARR of integers and a positive integer ‘K’. Your task is to find two non-overlapping subarrays (contiguous) each of length ‘K’ ...read more
You are given an N x N chessboard and a knight. On a chessboard, the knight can supposedly move in 8 different positions from its original position i.e. if the knight is original...read more
You have been given a number of stairs. Initially, you are at the 0th stair, and you need to reach the Nth stair. Each time you can either climb one step or two steps. You are...read more
You are Harshad Mehta’s friend. He told you the price of a particular stock for the next ‘N’ days. You can either buy or sell a stock. Also, you can only complete at most 2-transactions. Find ...read more
You have given a Singly Linked List of integers, determine if it forms a cycle or not.
A cycle occurs when a node's next points back to a previous node in the list. The li...read more
You have a car with a gas tank of infinite capacity. There are ‘N’ gas stations along a circular route. Gas stations are numbered from 0 to N - 1. You begin the journey with an empty tank at one of the ...read more
For a given string(str) and a character X, write a function to remove all the occurrences of X from the given string and return it.
The input string will remain unchanged if the given character(...read more
Aahad and Harshit always have fun by solving problems. Harshit took a sorted array and rotated it clockwise by an unknown amount. For example, he took a sorted array = [1, 2, 3, 4,...read more
You are given two integers N and K, you need to find the number of ways to divide N into k non-empty groups such that size of group[i] >= group[i - 1] for each valid i. Print it modulo 1...read more
You are given a string of lowercase characters. Your task is to rearrange (reorder) the string in such a way that no two adjacent characters are the same.
You have to return the rearranged strin...read more
Design and implement a data structure for Least Recently Used (LRU) cache to support the following operations:
1. get(key) - Return the value of the key if the key exists in the cache, o...read more
You are given an integer array 'ARR' of size 'N' and an integer 'S'. Your task is to return the list of all pairs of elements such that each sum of elements of each pair equals 'S'.
Note:
Each pair shou...read more
You have been given two strings, let's say 'STR1' and 'STR2' of equal lengths. You are supposed to return the minimum number of manipulations required to make the two strings anagrams.
Note:
A...read more
Given a Binary Tree, convert this binary tree to a Doubly Linked List.
A Binary Tree (BT) is a data structure in which each node has at most two children.
A Doub...read more
You are given an array/list 'ARR' consisting of N integers, which contains elements only in the range 0 to N - 1. Some of the elements may be repeated in 'ARR'. Your task is to find all ...read more
You are given an array Arr consisting of N integers. You need to find the equilibrium index of the array.
An index is considered as an equilibrium index if the sum of elements of the array to t...read more
You are given a connected, undirected and acyclic graph with some of the nodes as marked and a positive number 'K'. You need to return the count of all such nodes which have a dista...read more
You are given two strings ‘Version1’ and ‘Version2’ representing the version numbers. Your task is to compare them and find out which one of them is the latest version.
Note:
The input strings c...read more
Given an array/list 'ARR' of ‘N’ distinct integers, you are supposed to find the third largest element in the given array 'ARR'.
Input Format :
The first line contains a single integer ‘T’...read more
You are a string ‘S’. Your task is to count all the “substrings” of ‘S’ that contain only “vowels”.
Note :
1. The string ‘S’ consists of only lowercase English alpha...read more
You are given a Circular Linked List of integers, and an integer, 'key'.
You have to write a function that finds the given key in the list and deletes it. If no such key is prese...read more
In computing, a page fault is an exception for the memory management unit (MMU) when a process accesses a memory page without proper preparations. - Page Fault
Page replacement algorithm is needed to...read more
Given an array 'ARR'' of 'N' integers and an integer 'target', your task is to find three integers in 'ARR' such that the sum is closest to the target.
Note
In the case of two closest sums, print the...read more
You're given string ‘STR’ consisting solely of “{“, “}”, “(“, “)”, “[“ and “]” . Determine whether the parentheses are balanced.
Input Format:
The first line contains an Integer 'T' which denot...read more
You have been given a binary tree of integers. Your task is to print the boundary nodes of this binary tree in Anti-Clockwise direction starting from the root node.
NOTE:
The bo...read more
You have been given a text message. You have to return the Run-length Encoding of the given message.
Run-length encoding is a fast and simple method of encoding strings. The basic idea is to r...read more
You have been given an array/list of “VOTES” which contains the name of the candidates where each entry represents the name of the candidate who got the vote.
You are supposed to find the name of...read more
Find the total number of ways to distribute N items among three people such that :
Each person gets at least one item. Exactly one person among all the three people gets the maximum number of it...read more
Ninja has accidentally discovered a suitcase while digging a well in his lawn. But the suitcase is locked and there is a paper along with that suitcase on which instructions for opening the suit...read more
You are given a string ‘S’ representing a date in the “Day Month Year” format, where:
1. Day is represented as {"1st", "2nd", "3rd", "4th",”5th”, ...,”29th”, "30th", "31st"}. 2. Month is represente...read more
You are given a two-dimensional array/list of integers consisting of 0s and 1s. In the list, 1 represents land and 0 represents water.
The task is to find the number of distinct islands where a ...read more
Write a query that prints a list of employee names (i.e.: the name attribute) for employees in Employee having a salary greater than $2000 per month who have been employees for less than months. Sort your r...read more
You are given two strings S and X containing random characters. Your task is to find the smallest substring in S which contains all the characters present in X.
Example:
Let S = “abdd” and X = “b...read more
You are given a number N. You need to return the position of the rightmost set bit.
For example:
If the given number is 10 with the binary representation: 1010 The rightmost set b...read more
this was a standard water jug problem
You are given two jugs, a 4-gallon one and a 3-gallon one, a pump which has unlimited water which you can use to fill the jug, and the ground on which water may be pou...read more
You are given a Circular Singly Linked List of integers. Given a value ‘VAL’, delete the first occurrence of this value in the linked list. If the given value is not present, ret...read more
You are given a 2-dimensional array/list having N rows and M columns, which is filled with ones(1) and zeroes(0). 1 signifies land, and 0 signifies water.
A cell is said to be connected to...read more
Write a query that prints a list of employee names (i.e.: the name attribute) for employees in Employee having a salary greater than $2000 per month who have been employees for less than months. Sor...read more
'N' boxes are placed on a table. Each box has an integer label on it. The labels present on each box are given in the array 'ARR'. Two different boxes may or may not have the same label v...read more
What is TLB? Why is it used? What are huge pages and their advantages? Which is accessed first TLB or cache? Can we access TLB and cache in parallel?
He asked me various scenario based Managerial Questions and common HR questions.
Why should we hire you?
What are your hobbies?
How are system calls made at assembly level? How are IO operations like cout translated at low level?
Discussion about how the file system is stored on disk and how it works.
Given a Problem Statement and a Code we need to find the bug in the code and correct the given code.
Few questions on OOPs mainly focussing on private inheritance, destructors, virtual functions, and dynamic polymorphism
Given a Problem Statement and a Code we need to find the bug in the code and correct the given code.
Distinguish between RISC and CISC architectures.
Q52. A number x is given, two operation are allowed. Decrement by 1 and multiply by 2. find min operation to convert x to y.
Given a number x, find the minimum number of operations (decrement by 1 or multiply by 2) to convert it to y.
Use a breadth-first search (BFS) approach to explore all possible operations and find the minimum number of steps.
Start with x and generate all possible next numbers by decrementing or multiplying by 2.
Keep track of the number of steps taken to reach each number and stop when y is found.
Use a queue to implement the BFS algorithm.
Example: x = 10, y = 30. Possible steps:...read more
Q53. Given array of integer create subarray with sum = 0
Create subarrays with sum = 0 from given array of integers.
Iterate through the array and keep track of the running sum.
Store the running sum in a hashmap and check if the current sum - any previous sum equals 0.
If yes, then the subarray between those two indices has a sum of 0.
Q54. Combinatorics, find pivot in rotated sorted array, count sort
The question involves finding the pivot in a rotated sorted array using combinatorics and count sort.
To find the pivot in a rotated sorted array, we can use a modified binary search algorithm.
First, we compare the middle element with the first element to determine if the pivot is in the left or right half.
Then, we continue dividing the array in half and adjusting the search range based on the pivot's location.
Count sort is a sorting algorithm that works well when the range of...read more
Q55. System Design - Design a parking lot
Design a parking lot system with features like parking, retrieving, and tracking available spots.
Create a ParkingLot class with attributes like total number of spots, available spots, and a list of parked vehicles.
Implement methods for parking a vehicle, retrieving a vehicle, and tracking available spots.
Use data structures like arrays or lists to manage parked vehicles and available spots.
Consider implementing features like ticketing system, vehicle size restrictions, and pa...read more
Q56. Longest subsequence with sum zero
Find the longest subsequence in an array with sum zero.
Iterate through the array and keep track of the running sum.
Store the running sum in a hashmap along with the index.
If the same sum is encountered again, the subsequence between the two indices has a sum of zero.
Q57. System design: Hotel booking system
Design a hotel booking system for managing reservations and availability.
Use a database to store hotel information, room availability, and reservations.
Implement user authentication and authorization for booking.
Include a search feature for users to find available rooms based on their criteria.
Allow users to make reservations, modify or cancel them.
Send confirmation emails to users after successful bookings.
Q58. Sum of right leaf nodes, swap nodes in k groups
The question involves finding the sum of right leaf nodes and swapping nodes in groups of k.
The sum of right leaf nodes can be found by traversing the tree and checking if a node is a right leaf node.
Swapping nodes in groups of k can be done by iterating through the linked list and swapping the nodes in each group.
Examples: For the sum of right leaf nodes, consider a binary tree with nodes 1, 2, 3, 4, 5. The sum would be 5. For swapping nodes in groups of k, consider a linked...read more
Q59. Reverse nodes in k groups, sum of right leaf nodes
The question involves reversing nodes in groups of k and finding the sum of right leaf nodes.
Implement a function to reverse nodes in groups of k
Traverse the reversed linked list and find the sum of right leaf nodes
Handle edge cases like when the number of nodes is not a multiple of k
Q60. LLD for a S3 or a storage based system
LLD for a S3 or a storage based system involves designing the detailed architecture and components of the system.
Define the data model including objects, metadata, and storage classes
Design the system components like storage nodes, metadata servers, and access control mechanisms
Consider scalability, fault tolerance, and data consistency in the design
Implement features like versioning, encryption, and access control policies
Optimize for performance and cost efficiency
Q61. Find diameter of tree
The diameter of a tree is the longest path between two leaf nodes in the tree.
Calculate the longest path between two leaf nodes in the tree
This can be done by finding the height of the left and right subtrees and adding them together
The diameter of the tree is the maximum of either the diameter of the left subtree, the diameter of the right subtree, or the sum of the heights of the left and right subtrees
Q62. LLD for a storage based system
LLD for a storage based system involves designing the detailed architecture and components of the system to efficiently store and retrieve data.
Identify the requirements for the storage system, including data types, volume, access patterns, and performance expectations.
Design the data storage architecture, including data structures, indexing mechanisms, and storage technologies like databases or file systems.
Define the data access and retrieval mechanisms, such as APIs, proto...read more
Q63. Zigzag level order traversal of tree
Zigzag level order traversal of tree involves traversing the tree level by level in a zigzag pattern.
Use a queue to perform level order traversal of the tree
Alternate between left to right and right to left traversal for each level
Store the nodes at each level in separate arrays
Q64. Maximum Length of increasing subsequence
Find the maximum length of increasing subsequence in an array of strings.
Use dynamic programming to keep track of the length of increasing subsequences ending at each index.
Iterate through the array and update the length of increasing subsequences.
Return the maximum length found.
Q65. Design a product like google drive
A cloud storage service like Google Drive for storing and sharing files
Allow users to upload, store, and organize files in folders
Provide sharing options for files and folders with permissions
Include collaboration features like real-time editing and commenting
Offer integration with other services like Google Docs, Sheets, and Slides
Q66. Left view of binary tree
The left view of a binary tree is the set of nodes visible when the tree is viewed from the left side.
Traverse the tree in a level order manner and keep track of the first node at each level.
Use a queue to store nodes at each level and update the left view nodes accordingly.
Example: For a binary tree with root node 1, left child 2, and right child 3, the left view would be [1, 2].
Q67. What are Rest API calls?
Q68. Brief idea about destination packages.
Destination packages are pre-planned travel itineraries that include accommodation, transportation, and activities.
Destination packages are designed to provide a hassle-free travel experience.
They can be customized based on the traveler's preferences and budget.
Popular destination packages include beach vacations, city breaks, and adventure trips.
They often include guided tours, meals, and tickets to attractions.
Destination packages can be booked through travel agencies or on...read more
Q69. Describe a cinema API
A cinema API is a software interface that allows developers to access and interact with cinema-related data and services.
Provides information about movies, showtimes, theaters, and ticket availability
Allows users to search for movies, view trailers, and book tickets
May include features like seat selection, payment processing, and user reviews
Can integrate with external services like payment gateways and movie databases
Q70. Implementation of a vector
A vector is a dynamic array that can resize itself as needed.
A vector is typically implemented using a dynamically allocated array.
It provides constant time access to elements using index.
Vectors can grow in size by reallocating memory when needed.
Example: vector
vec; Example: vec.push_back(10);
Q71. Reverse a Linked List
Reverse a linked list by changing the pointers direction.
Start with three pointers: current, previous, and next.
Iterate through the linked list, updating the pointers to reverse the direction.
Update the head pointer to the last node to complete the reversal.
Q72. Explain resume points
Resume points are concise descriptions of your work experience, skills, and achievements listed on your resume.
Resume points should be clear, specific, and quantifiable.
Use action verbs to start each point, such as 'developed', 'implemented', 'analyzed'.
Include relevant metrics or results to demonstrate impact, such as 'increased sales by 20%' or 'reduced processing time by 30%'.
Q73. Build system for Tiny URL
Build a system for generating and managing Tiny URLs
Use a unique identifier for each long URL to generate a short URL
Store the mapping of short URL to long URL in a database
Implement a redirect mechanism to redirect users from short URL to long URL
Consider adding expiration dates for short URLs to manage storage
Implement analytics to track usage of short URLs
Q74. Experience in Cloud
Extensive experience in designing, implementing, and managing cloud-based solutions.
Designed and implemented scalable cloud architectures using AWS, Azure, or Google Cloud
Managed cloud infrastructure for high-traffic web applications
Experience with containerization technologies like Docker and Kubernetes
Implemented serverless computing solutions using AWS Lambda or Azure Functions
Q75. Past Program Managed
Managed a large-scale software development program for a financial services company.
Led a team of 20 developers and testers in delivering a new online banking platform
Implemented Agile methodologies such as Scrum to improve project efficiency
Collaborated with stakeholders to define project scope and prioritize features
Managed project budget and resources to ensure on-time delivery
Q76. Any idea about visa
Visa is a document that allows a person to enter, stay or leave a country for a specified period.
Visa requirements vary depending on the country and purpose of travel
Tourists usually require a tourist visa, while business travelers require a business visa
Some countries offer visa on arrival or e-visa facilities
It is important to check visa requirements well in advance of travel to avoid any last-minute issues
Top HR Questions asked in null
Interview Process at null
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month