美國各大公司 Online Assessment 整理 2022

Yi-An, Chen
Mar 1, 2022

這邊紀錄自己寫過的OA題目、參考資料、還有解題詳解。有些題目不一定有跟LeetCode完全一樣,盡量整理出來。

(PS: 有些題目詳解,LeetCode上都有就不會寫,或是當下尚未寫完,但會慢慢更新!)

參考網站: 一畝三分地LeetCode Discussion

TikTok

stars and bars

LeetCode: 2055. Plates Between Candles

此題跟LeetCode題型差不多,差別在input 為 startIndex, endIndex => Array of int ,然後起始從1開始

解題:https://leetcode.com/problems/plates-between-candles/discuss/1807755/Binary-Search-O(QlogN)-and-TikTok-OA-(Stars-and-Bars)

circular printer

LeetCode: https://leetcode.com/discuss/interview-question/1263982/thomson-reuters-oa-circular-printer

能夠想到負號取餘數,這題幾乎秒解

解題:

ancestral names

LeetCode: https://leetcode.com/discuss/general-discussion/851939/ancestor-problem

這題難處在於如何轉羅馬數字,可以先去做leetCode: 13. Roman to Integer,對於羅馬數字熟悉後這題就好解了。

解題:

Max Inversion

LeetCode: https://leetcode.com/discuss/interview-question/777188/find-size-3-inversions-in-a-list

解題: https://leetcode.com/discuss/interview-question/1807872/TikTok-OA-Find-length-3-of-Inversions-in-list

Shared interest

LeetCode: https://leetcode.com/discuss/interview-question/725801/amazon-shared-interest-problem

解題:

k smallest substring

Reaching points

LeetCode: 780. Reaching Points

Super Stack

preprocess date

--

--

Yi-An, Chen
0 Followers

Android App Programmer, Software Developer, International Students