!!!!!!!!!!!!!!!!!!!!!求大家加米!!!!!!
Citrix面的Senior SDE. 本帖是VO 第一轮。每一轮东西多。我分开发贴。
VO安排:
VO 第一轮2小时。 coding
VO 第二轮1.5小时。 basics about OOR, Data structure, operating system, networking.
VO 第三轮,BQ?
VO 第四轮,和Hiring Manager随便聊聊(之前就聊过了,不懂为什么还有个15分钟聊天)。
首先就我觉得Citrix还是比较注重实践能力的,不是一个完全的算法题。 算法非常简单。 但是如果是平时做项目不多的应届生我估计会被其他实践环节卡住。
VO 第一轮2 个小时。
第一题,给你一个文件,读出里面所有的words。分别统计最大word词频、含vowles最多的word、以及最多的word长度的频率。
代码如下(文件请看附件):
'''
1. mostCommonWord():
return the alphabetically smallest one.
2.mostVowelsWord():
countVowel(word)
return the word which has most vowels (the alphabetically smallest one.)
3. mostCommonLength():
return the smallest length if there are multiple candidates.
steps:
1. Read input file .
split every line into words
add every word to an array. (strip and clean the dirty words)
2. Loop: traverse every word. (1 loop)
2.1 add the word to dict (Key is word, val is the count)
2.2 Count the vowels of current word.
iterate very char in the word.
update the word which has most vowels (alphabetically smallest one)
2.3 get the length of current word.
countDic[length] += count of the length
if maxCountForLength < countDic[length]:
maxCountForLength = countDic[length]
maxCountLength = length
elif maxCountForLength == countDic[length]:
maxCountLength = min(maxCountLength, length)
3. mostCommonWord, mostVowelsWord, mostCommonLength
(print them)
range:
1. lower english letters. Convert them to lower case.
2. "sdsf1231^%%^%^",
ignore " " and ""
" w and ".strip()
3. empty.
return ""
'''
from typing import DefaultDict
from coit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'}
response = requests.get(url,headers=headers)
print(response.text)
employees = response.json()['data']
empHeap = []
for emp in employees:
heappush(empHeap, (-emp['employee_age'], emp['employee_salary'], emp['id']))
# 3. Find the winner
winnerAge, winnerSalary, winnerId = heappop(empHeap)
print(f"Winner is f{winnerId}, age={winnerAge}, original salary={winnerSalary}")
url = f"http://dummy.restapiexample.com/api/v1/update/{winnerId}"
#add params
response = requests.put(url, data = {'employee_salary':winnerSalary}, headers=headers)
if response.status_code in (200,204):
print("Update successfully!")
else:
print(f"Update failed! {response.status_code} " + response.text)
updateWinnerSalary(1000000)
|