Databricks OA 和其他大廠相比,難度中上,不僅有常規的程式設計題,還會結合 SQL、資料處理和分散式計算的考點,畢竟公司定位就是 大資料+AI 平臺。我這次幫學員做的 OA,大概 90 分鐘,包含兩道程式設計題 + 一道 SQL 資料處理。題型跟 Leetcode 高頻題差不多,但稍微有 Databricks 自家 flavor。
Databricks OA 面試概覽
| 模組 | 內容 | 時間 | 難度 | 考察重點 |
|---|---|---|---|---|
| 程式設計題 1 | Longest Substring Without Repeating Characters | ~25 min | ⭐⭐ | 滑動視窗、哈希表 |
| 程式設計題 2 | Merge Intervals | ~30 min | ⭐⭐⭐ | 排序、區間合併、邊界處理 |
| SQL 題 | 找到每個使用者最近一次登錄時間 | ~20 min | ⭐⭐ | 視窗函數、聚合、去重 |
| 總結 | 2道编程 + 1道SQL | 90 min | ⭐⭐~⭐⭐⭐ | 程式碼熟練度 + SQL 基礎 + 思維清晰 |
Databricks OA 真題分享
Problem 1: Binary String Operations
You are given a string binaryString consisting of ‘0’s and ‘1’s, and an array of strings requests containing two types of requests:
"count:": Find the number of ‘0’s inbinaryStringup to and including the specified 0-based index."flip": Flip all elements ofbinaryString, i.e., change every ‘0’ to ‘1’ and every ‘1’ to ‘0’.
Return an array answers, where answers[i] contains the answer for the respective count request.
Example
For binaryString = "111010" and requests = ["count:4", "count:6", "flip", "count:4", "flip", "count:2"], the expected output is [1, 2, 4, 0].
Problem 2: Swappable Numbers
You are given an array of integers numbers. Your task is to count the number of distinct pairs (i, j) such that 0 <= i < j < numbers.length and numbers[i] can be obtained from numbers[j] by swapping no more than two digits of numbers[j]. Note that if numbers[i] = numbers[j], the pair should also be counted.
Examples
- For
numbers = [1, 23, 156, 1650, 651, 165, 32], the output should be3. - For
numbers = [123, 321, 123], the output should be3.
Input/Output
- Input:
array.integer numbers(An array of positive integers)- Guaranteed constraints:
1 <= numbers.length <= 10^41 <= numbers[i] <= 10^9
- Guaranteed constraints:
- Output:
integer(The count of pairs fromnumbersmeeting the criteria)
Problem 3: Maximum Items by Budget
You are given an array of integers costs and a budget total. The costs array contains the costs of n items. Your task is to find the maximum number of items you can buy with your budget, total.
Example
For costs = [1, 3, 2, 4, 1] and total = 7, the output should be 4. You can buy items with costs 1, 1, 2, 3, which sum up to 7, which is the maximum number of items possible.
Input/Output
- Input:
array.integer costs,integer total - Guaranteed constraints:
1 <= costs.length <= 10^51 <= costs[i] <= 10^51 <= total <= 10^9
- Output:
integer(The maximum number of items that can be bought)
別再一個人死撐,助攻讓你事半功倍
很多同學在衝 Databricks 或北美大廠的 OA 時,都會有類似感受:題量大、時間壓得緊,臨場容易慌,結果發揮不出來。其實完全沒必要單打獨鬥。 Programhelp 一直提供 OA代寫、VO遠端實時提示、甚至面試全程代替,透過隱蔽穩定的方式,確保過程順利。無論是 保證全部測試點透過的筆試支援,還是 面試裡的即時提醒,甚至 一路陪跑直到 offer 落袋,都有成熟經驗和成功案例。如果你正準備 Databricks 或 FAANG,早點用對方法,比盲目刷題要高效得多。