<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KVGHS6G" height="0" width="0" style="display:none;visibility:hidden"></iframe>

Expedia面试真题

职位分类
全部
数据相关
计算机科学
人工智能
产品经理
BQ
全部(0)
1.Why are you looking for new postion
2.Find Anagram Word
3.Search in Rotated Sorted Array
4.String Compression
5.Best Time to Buy and Sell Stock
6.Finding Minimum Unique Integers After Removing K Elements
7.Minimum Cost to Fly People to Two Cities
8.Remove unique numbers
9.Finding the k-th Factor of an Integer
10.Two Sum Problem
11.Experiement design
12.Define function
13.Dice questions
14.Simpson paradox
15.Predictive model
16.Job application metric
17.SQL aggregation funciton
18.ML model basic application
19.SQL aggregation funciton
20.SQL aggregation funciton
21.Modify array
22.String functions
23.Football scores
24.SQL aggregation funciton
25.two sum 变种
26.Missing words
27.Metro land festival
28.Minimum Knight Moves
29.Add Two Numbers
30.Handwrite a K-means Algorithm
31.Resource Estimation for Task Scheduling
32.Music Streaming Platform Song Ranking Feature
33.Neural Network Layer Arrangement Optimization
34.Implement Linear Regression and K-Means Algorithm
35.SQL Coding Interview
36.Can you discuss your experience collaborating with cross-functional teams (XFN)?
37.Describe your experience with causal inference and statistical methods.
38.Describe your experience with fraud detection projects.
39.Variance vs Bias
40.Handling Class Imbalance
41.Optimization Techniques
42.Dealing with Collinearity
43.Differences between XGBoost and Random Forest
44.Database Schema Design for a Board Sharing Platform
45.Unsorted Stack Processing
46.Code Review and Testing
47.Minimum Operations to Balance Brackets
48.Behavioral Questions with Follow-ups
49.Coding Challenge with Two LeetCode Medium Problems Using Sliding Window Technique
50.Coding Challenge with Two LeetCode Easy Problems
51.Random Sampling from an Array with Probabilities
1. Why are you looking for new postion
Why are you looking for new postion?
2. Find Anagram Word
给一个长 sentence,找出里面没有 anagram的词
比如Came lAde Edal,返回的就是 came。需要注意忽略大小写,duplicates,单个字母(单个字母不算anagram)
3. Search in Rotated Sorted Array
There is an integer array nums sorted in ascending order (with distinct values).

Prior to being passed to your function, nums is possibly rotated at an unknown pivot index k (1 <= k < nums.length) such that the resulting array is [nums[k], nums[k+1], ..., nums[n-1], nums[0], nums[1], ..., nums[k-1]] (0-indexed). For example, [0,1,2,4,5,6,7] might be rotated at pivot index 3 and become [4,5,6,7,0,1,2].

Given the array nums after the possible rotation and an integer target, return the index of target if it is in nums, or -1 if it is not in nums.

You must write an algorithm with O(log n) runtime complexity.

 

Example 1:

Input: nums = [4,5,6,7,0,1,2], target = 0
Output: 4

Example 2:

Input: nums = [4,5,6,7,0,1,2], target = 3
Output: -1

Example 3:

Input: nums = [1], target = 0
Output: -1

 

Constraints:

  • 1 <= nums.length <= 5000
  • -104 <= nums[i] <= 104
  • All values of nums are unique.
  • nums is an ascending array that is possibly rotated.
  • -104 <= target <= 104
4. String Compression
Given an array of characters chars, compress it using the following algorithm:
 
Begin with an empty string s. For each group of consecutive repeating characters in chars:
 
If the group's length is 1, append the character to s.
Otherwise, append the character followed by the group's length.
The compressed string s should not be returned separately, but instead, be stored in the input character array chars. Note that group lengths that are 10 or longer will be split into multiple characters in chars.
 
After you are done modifying the input array, return the new length of the array.
 
You must write an algorithm that uses only constant extra space.
 
Example 1:
Input: chars = ["a","a","b","b","c","c","c"]
Output: Return 6, and the first 6 characters of the input array should be: ["a","2","b","2","c","3"]
Explanation: The groups are "aa", "bb", and "ccc". This compresses to "a2b2c3".

Example 2:
Input: chars = ["a"]
Output: Return 1, and the first character of the input array should be: ["a"]
Explanation: The only group is "a", which remains uncompressed since it's a single character.

Example 3:
Input: chars = ["a","b","b","b","b","b","b","b","b","b","b","b","b"]
Output: Return 4, and the first 4 characters of the input array should be: ["a","b","1","2"].
Explanation: The groups are "a" and "bbbbbbbbbbbb". This compresses to "ab12".
 
Constraints:
1 <= chars.length <= 2000
chars[i] is a lowercase English letter, uppercase English letter, digit, or symbol.
5. Best Time to Buy and Sell Stock
You are given an array prices where prices[i] is the price of a given stock on the ith day.
You want to maximize your profit by choosing a single day to buy one stock and choosing a different day in the future to sell that stock.
Return the maximum profit you can achieve from this transaction. If you cannot achieve any profit, return 0.
 
Example 1:
Input: prices = [7,1,5,3,6,4]
Output: 5
Explanation: Buy on day 2 (price = 1) and sell on day 5 (price = 6), profit = 6-1 = 5.
Note that buying on day 2 and selling on day 1 is not allowed because you must buy before you sell.
 
Example 2:
Input: prices = [7,6,4,3,1]
Output: 0
Explanation: In this case, no transactions are done and the max profit = 0.
 
Constraints:
1 <= prices.length <= 105
0 <= prices[i] <= 104