Redian新闻
>
问个近期亚麻高频题目
avatar
问个近期亚麻高频题目# JobHunting - 待字闺中
c*y
1
我原来的身份有健康保险,现在想转成我老公的dependent,转了以后用我老公的保险
。但是转身份可能要3~6个月,这期间是不是就没有健康保险?
avatar
g*i
2
Given a log file which consists of timestamp, customer ID, page id visited
by that particular customer. Write a function to return all customers who
have visited 5 unique pages in last 30 mins
这个题目最近看面经见得很多,还有类似的是这个:
http://www.mitbbs.com/article_t/JobHunting/32644779.html
avatar
c*d
3
转身份是转身份,转保险是转保险,不相干的。你现在就可以叫你老公把你作为
dependent加到他的保险上去。

【在 c*******y 的大作中提到】
: 我原来的身份有健康保险,现在想转成我老公的dependent,转了以后用我老公的保险
: 。但是转身份可能要3~6个月,这期间是不是就没有健康保险?

avatar
h*n
4
sort the log by timestamp
read the log and insert the entry to map(5)>
This is enough for this problem, whenever the vector reach size 5, push the
result into the result vector
For another problem, when read new entry, you need to pop_front and push_
back the new pageID in the tail of the mapped vector.
at the same time, maintain a map(5), int counter> and the
maximum counter value and page list.

【在 g*****i 的大作中提到】
: Given a log file which consists of timestamp, customer ID, page id visited
: by that particular customer. Write a function to return all customers who
: have visited 5 unique pages in last 30 mins
: 这个题目最近看面经见得很多,还有类似的是这个:
: http://www.mitbbs.com/article_t/JobHunting/32644779.html

avatar
c*y
5
谢谢,刚刚问过HR,转身份期间可以把我的健康保险转到我老公的保险下。
这样我就安心在美国了,怀孕了也不怕。

【在 c********d 的大作中提到】
: 转身份是转身份,转保险是转保险,不相干的。你现在就可以叫你老公把你作为
: dependent加到他的保险上去。

avatar
g*i
6
谢谢!
第一问可以避免排序吗? 感觉复杂度很高啊

the

【在 h****n 的大作中提到】
: sort the log by timestamp
: read the log and insert the entry to map(5)>
: This is enough for this problem, whenever the vector reach size 5, push the
: result into the result vector
: For another problem, when read new entry, you need to pop_front and push_
: back the new pageID in the tail of the mapped vector.
: at the same time, maintain a map(5), int counter> and the
: maximum counter value and page list.

avatar
p*2
7

排序nlogn,不排序n
不过一般这样的文件可能已经排好续了
如果用Clojure的话,一行代码应该可以搞定。

【在 g*****i 的大作中提到】
: 谢谢!
: 第一问可以避免排序吗? 感觉复杂度很高啊
:
: the

avatar
g*i
8
in last 30 mins
我的理解是和当前时间比,所以维护一个hashmap>就可以吧,
每读一行看时间是不是和当前时间差超过30分钟,如果不是,就把page_id放到hashset
里。
二爷请指教一下...

【在 p*****2 的大作中提到】
:
: 排序nlogn,不排序n
: 不过一般这样的文件可能已经排好续了
: 如果用Clojure的话,一行代码应该可以搞定。

avatar
p*2
9

hashset
没看过原题,不过感觉这样就可以了。

【在 g*****i 的大作中提到】
: in last 30 mins
: 我的理解是和当前时间比,所以维护一个hashmap>就可以吧,
: 每读一行看时间是不是和当前时间差超过30分钟,如果不是,就把page_id放到hashset
: 里。
: 二爷请指教一下...

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。