📣 黑五价提前开抢|VIP一年通行证5折,蓝莓、Offer多多同步特惠
回复: 5
跳转到指定楼层
上一主题 下一主题
收起左侧

Galaxy Digital

全局:

2019(7-9月) 码农类General 本科 全职@Galaxy Digital - 猎头 - HR筛选 技术电面  | | Other | 在职跳槽

注册一亩三分地论坛,查看更多干货!

您需要 登录 才可以下载或查看附件。没有帐号?注册账号

x
本帖最后由 大队管理员 于 2019-9-24 00:22 编辑

和一个quant聊了电面, 对方基本不会技术, 轻松忽悠, 然后email了我一道题, 原题底下:


Given a sorted array of N ints with duplicates, for example:



                1,2,2,2,2,2,4,12,12,12,53



count the number of occurrences of each unique element.



                1a) Solve this with an O(N) algorithm

                1b) Solve this with a better-than-O(N) algorithm and analyze its time complexity.


我的solution, 求大佬们指教

import collections
import bisect
import random
import timeit
import time
arr = [1,2,2,2,2,2,4,12,12,12,53]

def randomSortedList(num):
    res = []
    for i in range(num):
        res.append(random.randint(0, num))
    res = sorted(res)
    return res

#  1a) Solve this with an O(N) algorithm
# The below function will return a hashmap with each element as key, as their corresponding count as value
def search(arr):
    res = collections.defaultdict(int)
    for item in arr:
        res[item] += 1

    return res

您好!
本帖隐藏的内容需要积分高于 20 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 20 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限 或 查看其他获取积分的方式
Unlock interview details and practice with AI
Popular Interview Questions from Top Companies

print(search(arr))
print(binarySearch(arr))

print(search(arr2))
print(binarySearch(arr2))


"""
In terms of performance, method 1 performs better when there are more unique elements,
method 2 performs better when there are massive duplicates
"""


While it may be useful to run your code with the example array above, please also test it with a larger (ex., 100 elements) randomly generated, sorted array.




---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

recruiter第二天说代码非常好, 等对方回复onsite confirmation, 过了几天recruiter说, 抱歉, 对方内部有变化, 要等, 等了两周, 没信了 LOL
虽然对这个公司没兴趣,他们号称是做blockchain investment的, 但至少不行给个信啊





评分

参与人数 1大米 +40 收起 理由
匿名用户-BHNBO + 40

查看全部评分


上一篇:amazon 亚麻 2020 new grad oa2
下一篇:图钉OA
🔗
allenyan1985 2020-4-5 04:14:16 | 只看该作者
全局:
想问问后来Galaxy有回复吗
回复

使用道具 举报

🔗
 楼主| Hagen 2020-4-5 04:53:38 | 只看该作者
全局:
allenyan1985 发表于 2020-4-5 04:14
想问问后来Galaxy有回复吗

最后都没feedback,recruiter说好像是internal issue 然后on hold
回复

使用道具 举报

🔗
ZAFixer 2020-4-24 06:37:49 | 只看该作者
全局:
楼主还记得面试的quant叫什么以及大概面的什么吗?
回复

使用道具 举报

🔗
 楼主| Hagen 2020-4-24 06:39:48 | 只看该作者
全局:
ZAFixer 发表于 2020-4-24 06:37
楼主还记得面试的quant叫什么以及大概面的什么吗?

Taylor Evans
回复

使用道具 举报

地里匿名用户
🔗
匿名用户-8OPQI  2025-10-31 22:19:03
这家在地里的面经真少啊
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号
隐私提醒:
  • ☑ 禁止发布广告,拉群,贴个人联系方式:找人请去🔗同学同事飞友,拉群请去🔗拉群结伴,广告请去🔗跳蚤市场,和 🔗租房广告|找室友
  • ☑ 论坛内容在发帖 30 分钟内可以编辑,过后则不能删帖。为防止被骚扰甚至人肉,不要公开留微信等联系方式,如有需求请以论坛私信方式发送。
  • ☑ 干货版块可免费使用 🔗超级匿名:面经(美国面经、中国面经、数科面经、PM面经),抖包袱(美国、中国)和录取汇报、定位选校版
  • ☑ 查阅全站 🔗各种匿名方法

本版积分规则

>
快速回复 返回顶部 返回列表