folder_open

面試雜記

arrow_right
article

面試心得–Agoda 台灣雅高達國際有限公司

面試心得–Agoda 台灣雅高達國際有限公司

2022/12/28~2023/03/03【Backend、Senior Backend】邀請三面後人事凍結

職缺介紹

#

職位:BE, Sr. BE
薪資範圍:1.5M ~ 2M / Annum
面試流程:4 關 online interview,包括 live coding 及 system design(之前有聽說Agoda會招待機票讓面試者前往曼谷,但獵頭說該政策目前已取消)

公司概況

#

目前約 20~30 位台灣工程師,使用語言主要為 Java、Scala,其次是 Go、Python、.Net,注重架構改善的能力。由於會需要在泰國曼谷工作,公司有提供 4 年簽證,福利上也提供每周3天的WFH及每年30天的返鄉WFH。

Pre-Assessment Test 線上技術測驗(一小時)

#

共三題 easy 等級的題目。

第一題

#

第二題

#

第三題

#

第一輪線上技術測驗(主要面試官:Edwin,旁聽面試官:Suratin,一小時)

#

獵頭事前提供了準備方向與考古題給我,會有兩大題型:Calculator 及 Permutation,例題如下:

1. 給 [1,2,2,3,3,3] 找出最高次數與最少次數的差 => 3次3, 1次1 => 3-1    
做完問時間複雜度 
跟改良時間複雜度的方法
2. 做出 TwoSum Object 裡面有兩個 attr => store(number), test(amount): boolean 
const x = new TwoSum(); 
x.store(1); x.test(2) => false 
x.store(2); x.test(3) => true; x.test(2) => false 
會問test的時間複雜度 跟改良方法

實際上連續考了四題字串題目:

  1. Given a string, write a function that checks if the string is a palindrome
  2. Given a string, write a function that checks if there exists a permutation of the string that is a palindrome
  3. Given a string, write a function that returns the longest palindromic substr
  4. Write a function that returns the longest non repeating characters

雖然都是 LeetCode 經典題目,先前也刷過和看過解答,但是一小時的面試扣掉前面10分鐘開場只省下50分鐘可以思考及寫code,還要用不熟的英文和面試官討論演算法,一個緊張就沒辦法仔細回想答案了,最後只能交出 Naive Solution,整體表現完全不如預期呀!

第二輪線上技術測驗(主要面試官:Kraiwat Nimudomsukopen_in_new,一小時)

#

這關是純系統設計,要替預約系統設計優惠碼功能,詳細題目如下:

Requirement
- We want to introduce promo code on our website. User will get discount when book a hotel with promo code.
- There is a text box on booking page to input promo code.
- User will see discount on website before book.
- We will show error text when user input invalid promo code.
- There are 2 types of promo code
- Time period - Ex. Valid from 20 Dec 12:00 PM - 3 Jan 10:00 PM
- Limit usage - Ex. Only 500 bookings
- The promo code usage is counted when booking is success
- Promo code monitoring system
Context
- User traffic ~100k per day
- Booking process after user click book will take around 1 minute
- Booking is possible to fail from multiple reasons. Ex. Fraud, Pre-Auth, Settlement, Allotment, etc.

題目出得十分理性,不算難回答,但由於是線上測驗,開頭花了一些心力去學習白板軟體的操作,答題過程中也會因為不熟悉工具而處處受限,很難充分表達自己的思路,加上面試官有很重的口音,整場面下來雖然自認技術部份可以及格,但是溝通部分可能會失分。

人事凍結通知

#

Hi ***,

Thank you so much for your patience just now.

I would like to inform you that. Unfortunately, the role you interviewed for has been placed on hold for the time being due to our hiring preference has been changed and we would like to focus on candidates with more senior backgrounds. However, we are still in the process of finalizing if there is any other team would be interested in your profile.

We will be getting in touch and let you know at our soonest once we have the update on our hiring.

I hope you understand regarding to our changes and we do appreciate your time speaking with us.

Best Regards,

應徵結果及時程

#

  • 2022/12/28 與獵頭接洽
  • 2023/01/16 邀請 Pre-Assessment Test 線上技術測驗
  • 2023/01/20 Pre-Assessment Test 線上技術測驗
  • 2023/01/25 邀請第一輪線上技術測驗
  • 2023/02/06 第一輪線上技術測驗
  • 2023/02/08 邀請第二輪線上技術測驗
  • 2023/02/16 第二輪線上技術測驗
  • 2023/02/27 邀請第三輪線上技術測驗
  • 2023/03/03 人事凍結通知

附錄:Pre-Assessment Test 線上技術測驗題目參考解答

#

第一題

#

def solution(a):
def is_good_tuple(t):
return len(set(t)) == 2
ans = 0
for i in range(len(a) - 2):
if is_good_tuple((a[i], a[i+1], a[i+2])):
ans += 1
return ans

第二題

#

def solution(points):
r_count = 0
s_count = 0
w_count = 0
c_count = 0
n_count = 0
for p in points:
if 0 <= p <= 999:
r_count += 1
elif 1000 <= p <= 4999:
s_count += 1
elif 5000 <= p <= 9999:
w_count += 1
elif 10000 <= p <= 49999:
c_count += 1
elif 50000 <= p:
n_count += 1
tmp = zip(
[r_count, s_count, w_count, c_count, n_count],
["Recruit", "Soldier", "Warrior", "Captain", "Ninja"]
)
tmp2 = reversed(sorted(tmp, key=lambda x: x[0]))
ans = []
for (cnt, name) in tmp2:
if cnt > 0:
ans.append(f"{name} - {cnt}")
return ans

第三題

#

class Editor:
def __init__(self):
self.text = ""
self.cursor = 0
def onPressLeft(self):
self.cursor = max(0, self.cursor - 1)
return self.text
def onPressRight(self):
self.cursor = min(len(self.text), self.cursor + 1)
return self.text
def onPressHome(self):
self.cursor = 0
return self.text
def onPressEnd(self):
self.cursor = len(self.text)
return self.text
def onPressDelete(self):
if self.cursor < len(self.text):
self.text = self.text[0:self.cursor] + self.text[self.cursor + 1:]
return self.text
def onPressBackspace(self):
if self.cursor > 0:
self.text = self.text[0:self.cursor-1] + self.text[self.cursor:]
self.cursor -= 1
return self.text
def onInputCharacter(self, character):
self.text = self.text[0:self.cursor] + character + self.text[self.cursor:]
self.cursor += 1
return self.text
def solution(commands):
editor = Editor()
result = []
for command in commands:
if command == "left":
result.append(editor.onPressLeft())
elif command == "right":
result.append(editor.onPressRight())
elif command == "home":
result.append(editor.onPressHome())
elif command == "end":
result.append(editor.onPressEnd())
elif command == "delete":
result.append(editor.onPressDelete())
elif command == "backspace":
result.append(editor.onPressBackspace())
else:
result.append(editor.onInputCharacter(command))
return result

附錄:第一輪線上技術測驗題目參考解答

#

第一題

#

# Given a string, write a function that checks if the string is a palindrome
def is_palindrome(s):
n = len(s)
for i in range(n // 2):
if s[i] != s[n - i - 1]:
return False
return True
print(is_palindrome("a"))
print(is_palindrome("ab"))

第二題

#

# Given a string, write a function that checks if there exists a permutation of the string that is a palindrome
def is_permutation_a_palindrome(s):
freq_map = Counter(s)
odd_count = 0
for c, freq in freq_map.items():
if freq % 2 == 1:
odd_count += 1
return odd_count <= 1
print(is_permutation_a_palindrome("a")) # should be True
print(is_permutation_a_palindrome("ab")) # should be False
print(is_permutation_a_palindrome("abb")) # should be True
print(is_permutation_a_palindrome("")) # should be True

第三題

#

LeetCode 5. Longest Palindromic Substringopen_in_new

# Given a string, write a function that returns the longest palindromic substr
def longest_palindromic_substr(s):
n = len(s)
ans = ""
# left is inclusive, right is exclusive
for left in range(n):
for right in range(left, n + 1):
if is_palindrome(s[left:right]) and (right - left) > len(ans):
ans = s[left:right]
return ans
print(longest_palindromic_substr("aaa"))
print(longest_palindromic_substr("abad"))
print(longest_palindromic_substr("abcd"))
print(longest_palindromic_substr(""))
print(longest_palindromic_substr("eabcdad"))

第四題

#

LeetCode 3. Longest Substring Without Repeating Charactersopen_in_new

# Write a function that returns the longest non repeating characters
def longest_non_repeating_substr(s):
def is_non_repeating(subs):
n = len(subs)
if n == 1:
return True
for i in range(n - 1):
if subs[i] == subs[i + 1]:
return False
return True
n = len(s)
ans = ""
# left is inclusive, right is exclusive
for left in range(n):
for right in range(left, n + 1):
if is_non_repeating(s[left:right]) and (right - left) > len(ans):
ans = s[left:right]
return ans
print(longest_non_repeating_substr("a"))
print(longest_non_repeating_substr("abcd"))
print(longest_non_repeating_substr("aabcc"))
print(longest_non_repeating_substr("aabcbcc"))

附錄:第二輪線上技術測驗題目參考解答

#

面試結束前的白板截圖: