Expedia Group Interview Questions
Showing 54 questions
You're given a binary string and need to find the minimum number of flips to make it monotone increasing (all 0s before all 1s). Determine the fewest changes required to achieve this ordered structure.
#1. Flip String to Monotone Increasing
Given an array of numbers and a threshold, find the smallest divisor that ensures the sum of the divisions (ceiling) is less than or equal to the threshold. You need to efficiently search for this divisor.
#2. Find the Smallest Divisor Given a Threshold
Find the minimum number of swaps needed to group all 1's together in a binary array. Swaps can only happen between adjacent elements.
#3. Minimum Swaps to Group All 1's Together
Find the kth factor of a given number n. If n has fewer than k factors, return -1.
#4. The kth Factor of n
Determine how many combinations of three numbers from a given array can form the sides of a valid triangle. A valid triangle satisfies the triangle inequality theorem.
#5. Valid Triangle Number
You are given an array of integers. Determine the minimum number of operations needed to sort the array in non-decreasing order, where each operation involves replacing an element with one or more elements that sum to the original value.
#6. Minimum Replacements to Sort the Array
Reorder the words in a sentence such that they are arranged in ascending order of their lengths. If two words have the same length, maintain their original order.
#7. Rearrange Words in a Sentence
The goal is to transform a given integer to zero using a special set of bit manipulation operations. Find the minimum number of operations needed for this conversion.
#8. Minimum One Bit Operations to Make Integers Zero
Compress a given string by replacing consecutive repeating characters with the character followed by the count of repetitions. If the compressed string isn't shorter, return the original.
#9. String Compression
You're given a log of friendship connections over time. Find the earliest timestamp when everyone is connected in a single friendship group.
#10. The Earliest Moment When Everyone Become Friends
Given a string of digits, find the number of unique substrings where every digit present occurs the same number of times.
#11. Unique Substrings With Equal Digit Frequency
Determine if a given word is considered valid based on a specific set of rules or constraints. The goal is to check if the input string adheres to the specified validation criteria.
#12. Valid Word
You are given the start and end points of several rounds on a circular track. Determine which sectors of the track were visited most frequently and return them in sorted order.
#13. Most Visited Sector in a Circular Track
You're given a list of player skills. Your goal is to pair the players into teams such that each team has the same total skill level, and return the sum of the products of skill in each team.
#14. Divide Players Into Teams of Equal Skill
Determine the count of "good" binary strings of a specified length, where a string is good if it doesn't contain a certain substring. You're given the length of the string and the forbidden substring.
#15. Number of Good Binary Strings
Given a palindromic string, modify it to be non-palindromic by changing exactly one character. Find the lexicographically smallest non-palindromic string you can create.
#16. Break a Palindrome
Determine if a string containing parentheses is valid. A valid string has matching and properly nested opening and closing parentheses.
#17. Valid Parentheses
Given a string, remove duplicate letters so that each letter appears only once. Ensure the resulting string is the smallest in lexicographical order among all possible results.
#18. Remove Duplicate Letters
Given a list of words, group together all the anagrams. Anagrams are words that contain the same letters rearranged.
#19. Group Anagrams
Determine the minimum capacity needed for a ship to transport packages within a given number of days. You're given the weights of the packages and must find the smallest capacity that allows shipping all packages within the day limit.
#20. Capacity To Ship Packages Within D Days