avatar
问个几道结构设计题# JobHunting - 待字闺中
a*2
1
1.一组用户信息,包括first name, last name,phone number等等,设计一个结构存
储这些信息,能够动态添加,并且能根据first name或者last name进行查找。
我就想到用两个multimap存储,不知道有什么好的思路
2.顺便问道老题
In our indexes, we have millions of URLs each of which has a link to some
page contents, that is, URL->contents. Now, suppose a user types a query
with wild cards *, which represent 0 or multiple occurrences of any
characters, how do you build the indexes such that such a type of query can
be executed efficiently by finding all corresponding URLs->contents
efficiently. For example, given a query http://www.*o*ve*ou.com. You need to find iloveyou.com, itveabcu.com, etc
avatar
k*n
2

这不就是传统数据库么。。。
数据放在一个静态数组或者list里面,用BTREE或者HASHMAP做name的index
can
老题就看经典好了,IR领域的经典题,看怎么做模糊检索
大概就是做cyclic suffix tree,或者bi/tri-gram的index什么的
但是为什么这个能match到itveabcu呢?最起码结尾应该是ou吧?

【在 a**********2 的大作中提到】
: 1.一组用户信息,包括first name, last name,phone number等等,设计一个结构存
: 储这些信息,能够动态添加,并且能根据first name或者last name进行查找。
: 我就想到用两个multimap存储,不知道有什么好的思路
: 2.顺便问道老题
: In our indexes, we have millions of URLs each of which has a link to some
: page contents, that is, URL->contents. Now, suppose a user types a query
: with wild cards *, which represent 0 or multiple occurrences of any
: characters, how do you build the indexes such that such a type of query can
: be executed efficiently by finding all corresponding URLs->contents
: efficiently. For example, given a query http://www.*o*ve*ou.com. You need to find iloveyou.com, itveabcu.com, etc

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