注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
2022年9月参加了两次indeed日本的电面,外包给karat公司的面试,
面试一个小时,10分钟自我介绍+快问快答,题目有些忘了,但是有DB的选项
剩下时间是代码测试,测试全通过的情况下会给下一题,第一次在测试的时候卡在了第一题,申请了二次面
第二次做到第三道题的时候时间到了。面试总体感觉还不错,但是遗憾的是freeze了
一共遇到了下面的这几道题,希望可以帮到大家,也求些大米看帖🙇🏽♀️
第一道 :
the earliest and the last log of each users
Suppose we have an unsorted log file of accesses to web resources.
Each log entry consists of an access time, the ID of the user making the access, and the resource ID.
The access time is represented as seconds since 00:00:00, and all times are assumed to be in the same day.
Example:
logs1 = [
["58523", "user_1", "resource_1"],
["62314", "user_2", "resource_2"],
["54001", "user_1", "resource_3"],
["200", "user_6", "resource_5"],
["215", "user_6", "resource_4"],
["54060", "user_2", "resource_3"],
["53760", "user_3", "resource_3"],
["58522", "user_22", "resource_1"],
["53651", "user_5", "resource_3"],
["2", "'R']
-> [
['R', '', 'B', 'B']
['', 'R', 'B', 'B']
['B', 'R', '', 'B']
['B', 'R', 'B', '']
['B', '_', 'B', 'R']
]
Example #2:
start_2 = ['R', 'R', '']
end_2 = ['', 'R', 'R']
-> [
['R', 'R', '']
['R', '', 'R']
['_', 'R', 'R']
]
All Test Cases:
validMoves(start_1, end_1)
validMoves(start_2, end_2)
n: number of spaces in the board
"""
start_1 = ["R","","B","B"]
end_1 = ["B","","B","R"]
start_2 = ["R", "R", ""]
end_2 = ["", "R", "R"] |