由买买提看人间百态

topics

全部话题 - 话题: binary
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
l******n
发帖数: 648
1
来自主题: DataSciences版 - Locality Sensitive Hashing 问题
这个很好理解
比如你做一个数据查询服务,用来存储所有的饮料
比如coke,和pepsi,是很类似的饮料,相比较juice或者酒
这个similarity你是知道的
如果用最原始的办法存储,比如是原始的明文
coke
7 up
orange juice,
vodka
stella beer
.... 此处省略一万行
pepsi
你不能把这些东西都存在内存里,太大了,想想一个字符多大。你只能存在disk上。
一个简单的查询,输入coke,那么和它相似的饮料是什么?你需要在disk上,一个一个
的看,每个entry都要用你已经知道的similarity metric看,哪个算是相似。比如查到
pepsi,你发现similarity score是0.9 - ok找到了,return它。
这个查询要在disk上,很慢。
这时候就要用lsh。每个长长的字符串,都会变成一个很短的binary string 比如
0101010
而且是binary string的similarity,比如不同的个数,和原来你知道的字符串的
similarity近似
binary的字符串是很小的,因为是binary,一... 阅读全帖
l******n
发帖数: 648
2
来自主题: DataSciences版 - Locality Sensitive Hashing 问题
这个很好理解
比如你做一个数据查询服务,用来存储所有的饮料
比如coke,和pepsi,是很类似的饮料,相比较juice或者酒
这个similarity你是知道的
如果用最原始的办法存储,比如是原始的明文
coke
7 up
orange juice,
vodka
stella beer
.... 此处省略一万行
pepsi
你不能把这些东西都存在内存里,太大了,想想一个字符多大。你只能存在disk上。
一个简单的查询,输入coke,那么和它相似的饮料是什么?你需要在disk上,一个一个
的看,每个entry都要用你已经知道的similarity metric看,哪个算是相似。比如查到
pepsi,你发现similarity score是0.9 - ok找到了,return它。
这个查询要在disk上,很慢。
这时候就要用lsh。每个长长的字符串,都会变成一个很短的binary string 比如
0101010
而且是binary string的similarity,比如不同的个数,和原来你知道的字符串的
similarity近似
binary的字符串是很小的,因为是binary,一... 阅读全帖
d**e
发帖数: 6098
3
☆─────────────────────────────────────☆
gezwenti (gezwenti) 于 (Sun Feb 28 12:23:17 2010, 美东) 提到:
( 版主能给几个包子吗? 我从没得过包子, 说的也都是个人真实体验)
真的。 本人在墙街做IT已经六年多了, 拿的也是很普通的薪水, 我现在的Total是135K + 10-25% Bonus (奖金时好时坏, 大致在10% 到 25% 之间)
我只会Java/J2EE。 不会C++, 一点都不会。
现在的Project是做Post-Trading的Changing P&L, Position Calulation.整个
Department是Support Equity Trading的, 公司也是大家都知道的大投行。
我以前的面试经验, 包括我周围IT朋友的面试经验 从来没被问过本版这么难的问题,
1) B-Tree, Graph 这些都太难了, 从没被问过。 最多就问个Binary Tree, 遍历二叉
树。 红黑树都没问道过, 面试官自己都不知道。
2) 数据结构, 最多就问问... 阅读全帖
j*****2
发帖数: 457
4
来自主题: JobHunting版 - 小公司软工第一轮电面
Representations: Hash Table vs Binary Search Tree (self-balancing)
There are two main efficient data structures used to represent associative
arrays, the hash table and the self-balancing binary search tree. Skip lists
are also an alternative, though relatively new and not as widely used.
Relative advantages and disadvantages include:
* Hash tables have faster average lookup and insertion time (O(1)),
while some kinds of binary search tree have faster worst-case lookup and
insertion time (O(... 阅读全帖
g**u
发帖数: 583
5
马上就要G on site了,
求祝福。
下面是从本版收集到的Google的试题,便于大家查询。
申明:有的附带有解释说明的,也来自于本版或者网络,大家自己看, 不保证真确
http://www.mitbbs.com/article_t1/JobHunting/31847453_0_1.html
本人ECE fresh PhD,背景是电路/EDA,跟G业务基本没什么关系
同学内部推荐的,很简单的一次电面就给了onsite
题都不难,但是自己没把握好机会,出了一些小bug。
总的感觉,出错就是硬伤,宁可从最简单的算法写起,也不能出错。
电面:
1,Skip list, http://en.wikipedia.org/wiki/Skip_list
写code实现struct skip_list * find(struct skip_list *head, int value)
2,sorted array with repeated elements
for given element, find out its range.
e.g. A A B B B B B C C D D E F ... 阅读全帖
a********9
发帖数: 129
6
来自主题: JobHunting版 - 有人整理过FB的面试题么
之前稍微收集了一下
glassdoor
===================
edit distance
level traverse tree(高频)
1) Calculate the square root of a double(高频)
2) Given n intervals [si, fi], find the maximum number of overlapping
intervals.
3) Print all the paths from root to every leaf in a binary tree.
4) Print the sum of all the numbers at every vertical level in a binary tree
5) Given a set of n jobs with [start time, end time, cost] find a subset so
that no 2 jobs overlap and the cost is maximum ?
6) Given 1 trillion messages ... 阅读全帖
o*q
发帖数: 630
7
来自主题: JobHunting版 - G家leetcode题
Google
Show problem tags Hide locked problems
#
Title
Acceptance
Difficulty
Frequency
66 Plus One 35.4% Easy
146 LRU Cache 15.8% Hard
200 Number of Islands 29.7% Medium
288 Unique Word Abbreviation 15.7% Easy
163 Missing Ranges 30.3% Medium
56 Merge Intervals 26.7% Hard
228 Summary Ranges 26.0% Medium
308 Range Sum Query 2D - Mutable 20.8% Hard
279 Perfect Squares 34.1% Medium
388 L... 阅读全帖

发帖数: 1
8
我的名字叫雷锋。My name is Feng Lei.
# Title Solution Acceptance Difficulty Frequency
2
Add Two Numbers 28.2% Medium
3
Longest Substring Without Repeating Characters 24.5% Medium
535
Encode and Decode TinyURL 74.0% Medium
5
Longest Palindromic Substring 25.2% Medium
15
3Sum 21.8% Medium
238
Product of Array Except Self 50.0% Medium
17
Letter Combinations of a Phone Number ... 阅读全帖
w********1
发帖数: 3492
9
Thu, 05 Jul 2012 06:31:17 PDT
Instapaper developer Marco Arment notes that Apple's App Store is apparently
pushing out corrupted app binaries of a number of different applications to
users. The issue, which renders the apps unusable, has apparently been
triggered on app updates approved over the past few days.
Characterizations of this issue:
- The app crashes immediately on launch, every time, even after a delete and
reinstall as long as the corrupt file is being served by the App Store.
- It ... 阅读全帖
f****g
发帖数: 4248
10
梦老,不准嘲笑我们化学WSN。
This is a very common question, and it is due to the use of different definitions of the prefixes kilo-, mega-, and giga -. The true meanings of these are thousands, millions, and billions. However, in binary arithmetic 1000 is not an integer power, but 1024 is. Because this is close to 1000, early computer scientists started calling it a kilo also, and it continues to this day.
So, we now have the two sets of definitions for these prefixes; decimal notation and binary notation. ... 阅读全帖
b**********7
发帖数: 103
11
[更新Google Intern Interview 过程解释]
感谢很多朋友来信。鉴于大家都很关心Google Intern的过程,我来详细的说说吧。Google intern interview的过程好像和以前不太一样了,目前在发正式offer前,需要经历2轮电话interview,然后会进入一个candidate pool,由manager来挑选,这个过程叫host bidding.
1. 电话interview: 都是google的开发人员来面的,所以比MS的HR难。当然从另一个方面来说,因为开发人员更容易理解你的code,你更容易和他们沟通。每个人大约2道题。其中一个人两个都是算法。另一个就会问一道概念题(当然,是很多小概念),一道算法。面完后,他们把feedback发给HR,如果两个人对你的评价都是positive,那么恭喜,你进入candidate pool 了。一般这个要等待1天到几周不等。
2.我电面是用google doc, 每次写一点儿要保存,有些麻烦。尤其是你要加个外层循环,需要把每一行都缩进,很麻烦。我个人不建议先在IDE里写,因为这是个interactive... 阅读全帖
S**I
发帖数: 15689
12
来自主题: JobHunting版 - [合集] 问个google面试题
☆─────────────────────────────────────☆
Bayesian1 (Jason) 于 (Tue Jun 21 01:52:31 2011, 美东) 提到:
Given a binary tree, find 2 leaf nodes say X and Y such that F(X,Y) is
maximum where F(X,Y) = sum of nodes in the path from root to X + sum of
nodes in the path from root to Y - sum of nodes in the common path from root
to first common ancestor of the Nodes X and Y
☆─────────────────────────────────────☆
SecretVest (Secret Vest) 于 (Tue Jun 21 04:01:30 2011, 美东) 提到:
not hard if someone is used... 阅读全帖
L*********g
发帖数: 8
13
来自主题: JobHunting版 - 问个G家店面题完全二叉树
Write a function to validate a complete binary tree. That is, the function
will take a binary tree as an input argument and return true if the given
binary tree is a complete binary tree.
A binary tree is complete if all levels except possibly the last are
completely full, and the last level has all its node to the left side.
For example, the following is a complete binary tree:
a
/ \
b c
/
d
The followings are not complete binary trees:
a
/ \
b ... 阅读全帖
z****l
发帖数: 5282
14
来自主题: Money版 - [合集] 遇到奸商
☆─────────────────────────────────────☆
binary (erazer) 于 (Wed Sep 22 03:53:02 2010, 美东) 提到:
几个月前有个灭虫公司上门推销,说是下个个礼拜回来我们这条街,给我们街上的住户
折扣。
也说了以后每3个月都会来一次。我问能不能提前cancel,只享受第一次的折扣价。
小伙子说没问题。小伙很能说,把我忽悠的挺高兴。于是没仔细看条款就签了名。
过了几天想cancel的时候被告知不满一年cancel会有两百多块的cancellation fee。
仔细看条款还真有。
怪我自己被小伙忽悠了。但是觉得他们太不厚道,不把后果说清楚。
还是很生气的坚决cancel了,而且决定拒付cancellation fee。
来美十年第一次赖帐。
前几天他们吓唬我说会找讨债公司。
我说go ahead,不相信200多块会有讨债公司接。
不过心里还是有点打鼓,不知他们能搞出什么后果。
也提请大家注意签字之前一定要看清所有条款。
☆─────────────────────────────────────☆
mas... 阅读全帖
N*******3
发帖数: 2589
15
来自主题: TeX版 - texlive 2012 发布啦
这个每次都只能完全重装么?
有点大的说。
何况还没那么大必要~~
MacTeX-2012
MacTeX-2012 installs updated versions of the GUI applications that were
already in MacTeX-2011.
MacTeX has optional packages to install two font collections (Latin Modern
and TeX Gyre) in /Library/Fonts; these TeX fonts are already in TeX Live,
but installing them in /Library/Fonts makes them available to standard
Macintosh applications like Adobe Illustrator. By default, these fonts are
not installed.
MacTeX installs the latest version of Ghostscript... 阅读全帖
c**y
发帖数: 172
16
来自主题: JobHunting版 - 发AMZ电面经,攒 RP
我的回答主要从dictionary operations的角度出发的。分别回答了这四种数据结构在
search, insert, delete操作下的算法复杂度。另外附加了memory consumption的讨论。
binary tree通常用来和hash table比较。binary tree的traversal比hash table方便
一些。另外虽然hash table的上述操作都是O(1),但是suffer的collision问题。
binary tree可以扩展到binary search tree
哦,如果知道在计算机系统里什么是用binary tree和hash table实现的好像更能
impress面试官。是不是文件系统就是binary tree做的?
L***Q
发帖数: 508
17
来自主题: JobHunting版 - 上周Juniper onsite面经
大概三周前phone interview,现在还有印象的是三个问题。
1. 两个computer分别在两个lan,两个lan之间是internet。问题:一个computer往另一个computer发packet时候,layer2、layer3的全过程。
2. 32bit integer reverse。我给了两种答案,一个是bit by bit;一个是网上流传的用mask的方法。interviewer说她不知道第二种
3. 给一个binary tree,如何判断是不是BST。我又给了两个solution。一个是从root往下,每个node给children传valid range。第二个solution是从leaf往root,每个node把以自己为root的subtree的range传给自己的parent。
上周四San Jose去onsite,首先感谢去之前在版上bless我的同志们。面的这个group是做data forwarding software的,全组老印。manager老印给人感觉很不错,口音也不重。一共面了6个人,其中两个小印一看就是非要考倒我不可的架势。第一个小印问... 阅读全帖
G******i
发帖数: 5226
18
☆─────────────────────────────────────☆
peking2 (myfacebook) 于 (Mon Jan 2 14:20:16 2012, 美东) 提到:
刚刚从某渠道得到A家SDET onsite的feedback, 一会儿写面经。
This candidate interviewed with Amazon and did poorly for an SDET
position.
Based on the feedback, I’m not going to pursue. Thanks.
☆─────────────────────────────────────☆
Perl (^_^) 于 (Mon Jan 2 14:27:10 2012, 美东) 提到:
...
☆─────────────────────────────────────☆
deepthroat (deepthroat) 于 (Mon Jan 2 14:41:13 2012, 美东) 提到:
是亲身经历吗?

☆───────────... 阅读全帖
d**s
发帖数: 98
19
http://zhedahht.blog.163.com/blog/static/2541117420071271047592
程序员面试题精选100题(01)-把二元查找树转变成排序的双向链表[数据结构]
2007-02-27 22:47:59| 分类: 树 | 标签:就业 找工作 编程 数据结构 算法
|字号大中小 订阅
题目:输入一棵二元查找树,将该二元查找树转换成一个排序的双向链表。要求不
能创建任何新的结点,只调整指针的指向。
比如将二元查找树
10
/ \
6 14
/ \ /  \
 4 8 12   16
转换成双向链表
... 阅读全帖
b*****n
发帖数: 618
20
来自主题: JobHunting版 - RF 面经
姑且称为RF吧
申请的是fresh grad职位,2月底第一次跟hr联系到这个周拿到offer,中间经历了
online code test,onsite和一次电面。
好像不少人对他家的code test比较感兴趣,4个小时两道题,每个人遇到的题目可能不
一样,
第一题很简单,主要考察code质量,第二题稍微难一点,每个题目的要求都很详细要仔
细看,还有详细的提示也要注意。
我遇到的题:
1. 一个矩阵,从指定格子向右发射激光,每个格子有以下几种可能:激光直接穿过,
或者改变激光方向(4个方向)
问激光射出矩阵之前一共经过了多少格子,如果死循环了就输出-1
2. 一堆racer,每个racer有出发时间和到达时间,计算每个racer的score,规则如下
:score = 所有出发比自己晚但是到达比自己早的racer数量之和,(所有的出发时间
和到达时间没有重复的)要求时间复杂度 code test过了之后我直接就安排onsite了,onsite本来安排6个人但实际上只面了5个
,题目如下:
1. 两个不一样长度的sorted array,求median。
leetcod... 阅读全帖
b*****n
发帖数: 618
21
来自主题: JobHunting版 - RF 面经
姑且称为RF吧
申请的是fresh grad职位,2月底第一次跟hr联系到这个周拿到offer,中间经历了
online code test,onsite和一次电面。
好像不少人对他家的code test比较感兴趣,4个小时两道题,每个人遇到的题目可能不
一样,
第一题很简单,主要考察code质量,第二题稍微难一点,每个题目的要求都很详细要仔
细看,还有详细的提示也要注意。
我遇到的题:
1. 一个矩阵,从指定格子向右发射激光,每个格子有以下几种可能:激光直接穿过,
或者改变激光方向(4个方向)
问激光射出矩阵之前一共经过了多少格子,如果死循环了就输出-1
2. 一堆racer,每个racer有出发时间和到达时间,计算每个racer的score,规则如下
:score = 所有出发比自己晚但是到达比自己早的racer数量之和,(所有的出发时间
和到达时间没有重复的)要求时间复杂度 code test过了之后我直接就安排onsite了,onsite本来安排6个人但实际上只面了5个
,题目如下:
1. 两个不一样长度的sorted array,求median。
leetcod... 阅读全帖
c*******r
发帖数: 610
22
来自主题: JobHunting版 - 上几个面经顺求Bless
最近面了几家公司,上店面经, 攒点人品
amazon
三哥,given a binary matrix, find out the total number of islands, (
geeksforgeeks原题)
跟这里的面经一模一样:http://www.mitbbs.com/article_t/JobHunting/32721661.html
面得很早1月底瑞苦肉特找我就随便面了下,很久没有准备算法了,知道是dfs,但是写
不出来,汗啊,挂了,自此以后努力准备3个月的算法
bloomberg
版上国人大哥内推的,无论如何应该感谢。
国人大哥先要面试我才决定给我内推(可能大哥办事认真)。 内推后另一位国人大哥
面的,虽然
说的是英文,告诉我的是英文名,但是改不了口音,一堆c++问题,好多都忘了,大概
有几道是下面的:
1. c++ pointer/reference, when to use pointer, when to use reference
2. implement linked list. implement copy assignment operator fo... 阅读全帖
a****a
发帖数: 5763
23
在美国宾夕法尼亚州的东部,有一个风景秀美的城市叫费城。在这个城市诞生了一系列
改变世界的奇迹:第一个三权分立的国家——美立坚合众国,就在第五街的路口诞生;
举世闻名的费城交响乐团,1900年在市中心的Academy of Music奏响了他们的第一个音
符。而写这篇文章时,我正坐在三十四街的宾夕法尼亚大学计算机系的一楼实验室,面
前摆放着世界上第一台电子计算机——ENIAC。
1946年2月14日,ENIAC问世,每秒可运行5000次加法运算或500次乘法运算,面积达170
平方米,重约30吨,拉开了计算机处理器革命的序幕。这场革命是各处理器厂商长达数
十年的竞赛,而摩尔定律从一开始就准确地预测了这场比赛的走势。根据摩尔定律,同
样价格的集成电路上可容纳的晶体管数目,每隔约18个月便会增加一倍,性能也将提升
一倍。但事实上,并无法用老路子来保持这个增长速度,因为会遇到包括能耗、散热等
各种技术瓶颈。所以每隔几年就会有用来绕过这些瓶颈的新一代产品推出。如采用超纯
量(superscala)、指令管线化、快取等。这些技术通过一定程度的高效并行来挖掘计
算机处理器的速度所能达到的高度,以促使... 阅读全帖
x****r
发帖数: 99
24
wiki里面那个还稍微麻烦了,他那样是可以retrieve这个sequence的方法,如果只需要
长度,可以这样做
数组a[i]里面可以存长度为i的子序列,最小的结尾是多少
基本是这样
数组: 99 100 100 1 2 3 4
第1步. 99 :binary search 最大一个<=99的,没有,所以a[1] = 99;
第2步. 100 :binary search 最大一个<=100的,就是a[1], 所以a[2] = 100;(意
思是现在长度为2的不减数列最少是100结尾)
第3步. 100 :binary search 最大一个<=100的,是a[2],所以a[3] = 100;
第4步. 1 : binary search 最大一个<=1的,没有,所以a[1] = 1;
第5步. 2 : binary search 最大一个<=2的,是a[1],所以A[2] = 2;
第6步. 同上,设置a[3] = 3;
第7步. 同上, 设置a[4] = 4;
至此,取得最大的a的index,就是4,所以长度最长的不减小子串是4,不知道讲明白了
没有
I**********s
发帖数: 441
25
来自主题: JobHunting版 - Google点面
问了1) 研究, 2) 多线程程序设计, 3) 任意无穷字符串流, 内存有限, 找出唯一一对
重复字符串, 这个我说了哈希表和外部排序, 但是面试人说有更好的办法(后来想也许
是bloom filter), 然后追问外部排序的细节到结束. 估计要挂 :(
总结: 面试既是技术活, 又是运气活.
无论如何, 把我的准备工作放下面, 攒点rp, 希望对大家有所帮助.
Interview Qs
Data Structures
1. Integer
- find number of 1s
- next largest smaller
- smallest larger number
- determine if is palindrom
- itoa, atoi
- add 2 numbers w/o using + or arithmetic operators
- implement *, -, / using only +
- find max of two numbers w/o co... 阅读全帖
l*****a
发帖数: 14598
26
来自主题: JobHunting版 - 判断 bst 疑问
Binary search tree
From Wikipedia, the free encyclopedia
In computer science, a binary search tree (BST) or ordered binary tree
is a node-based binary tree data structure which has the following
properties:
The left subtree of a node contains only nodes with keys less than the
node's key.
The right subtree of a node contains only nodes with keys greater than
the node's key.
Both the left and right subtrees must also be binary search trees.
o******e
发帖数: 81
27
来自主题: JobHunting版 - Amazon面经
phone interview 1: http://www.mitbbs.com/article_t0/JobHunting/31779867.html
phone interview 2: http://www.mitbbs.com/article_t0/JobHunting/31787957.html
phone interview 3: merge sort,popular三连击,说完思路后让我写code email给他
。single machine和map reduce的version。
on-site: 签NDA了,简要的说说
加lunch一共6轮,同时interview两个team
组A的dev manager + shadow MM:
一个关于他们组做的东西的OO design,比较open
又问我popular三连击,我说问过了,他说这是他的question被人偷了。。
Check if binary tree is symmetrical
闲聊大概15分钟
组B的senior dev
array shuffling
binary tree怎么... 阅读全帖
B*******1
发帖数: 2454
28
来自主题: JobHunting版 - 问个amazon面试题
isn't it
full = complete && nodeNumber = 2^height - 1
?
from wiki:
A full binary tree (sometimes proper binary tree or 2-tree or strictly
binary tree) is a tree in which every node other than the leaves has two
children.
A complete binary tree is a binary tree in which every level, except
possibly the last, is completely filled, and all nodes are as far left as
possible.[2]
r*****n
发帖数: 20
29
来自主题: JobHunting版 - 问个amazon面试题
//A full binary tree (sometimes proper binary tree or 2-tree or strictly
binary tree) is a tree in which every node other than the leaves has two
children.
bool isFull(Node *s){

if(!s->L && !s->R)
return true;

if(!s->R || !s->L)
return false;

return isFull(s->L) && isFull(s->R);
}
//A complete binary tree is a binary tree in which every level, except
possibly the last, is completely filled, and all nodes are as far left as
possible.[2]
int minHeight(Node *... 阅读全帖
S**I
发帖数: 15689
30
来自主题: JobHunting版 - [合集] 微软面试的一道题
☆─────────────────────────────────────☆
sugarbear (sugarbear) 于 (Thu Apr 7 00:42:48 2011, 美东) 提到:
找 二叉树 两个最大的相同子树
没答上来。
见了四个,被拒了。 第二个是manager,后来主动写信跟我联系,说把我推荐给industry recruiting team,不知道是不是有转机? 觉得industry recruiting应该更难吧? 求祝福!
☆─────────────────────────────────────☆
boohockey (Pursuit of Dreams!) 于 (Thu Apr 7 10:27:03 2011, 美东) 提到:
bless
这道题有没有正解

industry recruiting team,不知道是不是有转机? 觉得industry recruiting应该更
难吧? 求祝福!
☆─────────────────────────────────────☆
grass (美丽人生) 于 (Thu Apr... 阅读全帖
i**********e
发帖数: 1145
31
来自主题: JobHunting版 - 问一道careercup150上的题
这道题经典解法(Step-wise linear search, 也就是 lz 的解法) 是 O(N+M),不是
O(N*M). 可以选择从左下角 或者右上角 都可以。
网上已经列出五种解法 并一起以真实数据比较算法速度。发现竟然 Improved Binary
partition (利用二分) 的算法是最快的。但是这个算法的复杂度非常难证明,如果
有人可以证明出来,我愿意发完我所有包子给他。
Binary Search: 31.62s
Diagonal Binary Search: 32.46s
Step-wise Linear Search: 10.71s
Quad Partition: 17.33s
Binary Partition: 10.93s
Improved Binary Partition: 6.56s
http://www.leetcode.com/2010/10/searching-2d-sorted-matrix-part
l****i
发帖数: 2772
32
来自主题: JobHunting版 - A家三个电面的面经
Update:居然收到了onsite的邀请,三面结束正好2周。很神奇。希望onsite能好运。
一面:
美国人,感觉面试官没有任何准备,没有用collabedit.
coding: BST的深度。
我:BST的深度和普通BT的深度,计算上应该是一样啊。
面试官:恩,好像是
我电话里给了递归计算BT的程序
design:设计一个电影院管理系统
我给了一个类似于MVC的design。一个room class,一个movie class,一个manager
class。
又问了一些基础问题,什么是inheritance之类的。
二面:
美国人,直接collabedit
coding:罗马数字转变为int
design:扑克牌,特别让写了shuffle的代码
面试官最后说excellent,会汇报给HR。
这时以为能拿到onsite了,结果HR说要安排三面。
三面:
印度三姐,直接collabedit。三姐强调,写coding之前,要先和她说我的算法思路。
coding:
BST的LCA,写完,三姐说“do u see the problem in your code?”我纳闷,这题都是
练过... 阅读全帖
r*********n
发帖数: 4553
33
来自主题: JobHunting版 - 问个题目,找不在区间内的所有数
这种题目一看就知道对方想考察的是binary search的变体
描述算法比较verbose,这里给个例子
interval array A: [{1, 3}, {3, 4}, {7, 12}, {9, 10}] //按照[1, 3, 7, 9]来排
的顺
integer array B: [4, 5, 10]
1. binary search (actually upper_bound) B[0] = 4 in A: get i = 2 (if A[i]==
4,then ++i)
2. iterate through A[0, ..., i-1] until you find the first index j such that
its end time is >= 4: j = 1
3. because j < i, 4 is contained in an interval
4. binary search B[1] = 5 in A: get i = 2
5. iterate through A[j, ..., i-1] (j = 1) until you find t... 阅读全帖
a***e
发帖数: 413
34
来自主题: JobHunting版 - 明天去G家onsite LC刷了0.8遍
wiki上对random tree的定义都有好几种,从没看到过的光是要理解题意也得花不少时
间吧?
http://en.wikipedia.org/wiki/Random_binary_tree
Uniformly random binary trees[edit]
The number of binary trees with n nodes is a Catalan number: for n = 1, 2, 3
, ... these numbers of trees are
1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796, … (sequence A000108 in OEIS).
Thus, if one of these trees is selected uniformly at random, its probability
is the reciprocal of a Catalan number. Trees in this model have expected
depth proportional to the squa... 阅读全帖
a******p
发帖数: 157
35
来自主题: WashingtonDC版 - 犯众怒的,要不要关小黑屋啊?
haha,谁让你上周不去钓鱼的,放鸽子损人品的:)发包子吧
数据库大牛,另外问个简单问题:有什么办法导出有binary 列的table数据, 还能还
原导入table 吗?
binary(16), 我觉得用指定的 delimiter 也没办法,因为binary(16)可以有binary
string=delimiter 的binary。 现在只能转换成hex然后再导入时转换回
g**u
发帖数: 13
36
来自主题: WmGame版 - 哪有LINUX下的Mud client ?
谢谢,我有了,不过我在安装mud (fy3 ) 在freeBSD 2.2.7上的时候
碰钉子了,谁能帮帮我?
下面是报错信息和config.fy3的前部分内容
% ./driver config.fy3 &
[1] 17313
% using config file: config.fy3
Initializing internal tables....
----------------------------------------------------------------------------
风云三(本地) (MudOS v21.7) starting up on FreeBSD - Sun Mar 21 16:58:10 1999
Connected to address server on localhost port 9990
adm/simul_efun/file.c line 20: Undefined function seteuid
adm/simul_efun/object.c line 57: Undefined function getuid
ad... 阅读全帖
c*****t
发帖数: 1879
37
来自主题: Java版 - NestedVM
This thing is pretty cool. Converts C/C++ binary (not source)
to Java binary. Basically, compile code into MIPS binary, then
it maps this binary to JVM binary.
http://nestedvm.ibex.org/
Encountered it when I was looking for SQLite JDBC driver.
y**3
发帖数: 267
38
来自主题: Statistics版 - ROC Analysis - help needed!
Not sure what you are talking about. You mentioned binary parameter and
binary outcome.
My guess is your dependent variable is binary. For your A, the predictor set
are all binary; your B, the predictor set includes binary and continuous.
for either of the two, you can compute AUC for comparison
z*******n
发帖数: 1034
39
http://www.informit.com/articles/printerfriendly/2211695
Introduction to "The Java Language Specification, Java SE 8 Edition"
By James Gosling, Gilad Bracha, Alex Buckley, Bill Joy, Guy L. Steele
Date: Jun 12, 2014
The Java® programming language is a general-purpose, concurrent, class-
based, object-oriented language. It is designed to be simple enough that
many programmers can achieve fluency in the language. The Java programming
language is related to C and C++ but is organized rather dif... 阅读全帖
b****l
发帖数: 23606
40
我不是跟你说我不知道什么是decision tree了么?
至于什么是logistic reg
自己看维基去。
关于logit model 和probit model的区别,恐怕你从来没学过吧?
Logistic regression
From Wikipedia, the free encyclopedia
Jump to navigation
Jump to search
"Logit model" redirects here. It is not to be confused with Logit function.
In statistics, the logistic model (or logit model) is a statistical model that is usually taken to apply to a binary dependent variable. In regression analysis, logistic regression or logit regression is estimating the parameters of a... 阅读全帖
h******x
发帖数: 10156
41

definitions of the prefixes kilo-, mega-, and giga -. The true meanings of
these are thousands, millions, and billions. However, in binary arithmetic
1000 is not an integer power, but 1024 is. Because this is close to 1000,
early computer scientists started calling it a kilo also, and it continues
to this day.
notation and binary notation. The number of bits in each is:
have 160 (decimal) gigabytes, or 160 billion bytes. ''My Computer'' uses
the binary notation and says you have 149 (binary) gi... 阅读全帖
e******e
发帖数: 1098
42
业务素质

definitions of the prefixes kilo-, mega-, and giga -. The true meanings of
these are thousands, millions, and billions. However, in binary arithmetic
1000 is not an integer power, but 1024 is. Because this is close to 1000,
early computer scientists started calling it a kilo also, and it continues
to this day.
notation and binary notation. The number of bits in each is:
have 160 (decimal) gigabytes, or 160 billion bytes. ''My Computer'' uses
the binary notation and says you have 149 (binar... 阅读全帖
f*******5
发帖数: 52
43
来自主题: JobHunting版 - bloomberg电面
刚面完,印度人面的,口音能听懂。先问了做过的project。
然后进入technical环节,问了static是啥意思,然后问如果有两个全局变量i,j,i是
static,j
不是,i和j有啥区别。我说没区别,这两个到底有什么区别?
然后问了process和thread的区别,这个我不知道,冷场半天,后来回答得把自己绕晕
了。
然后问malloc有没有可能没申请到内存,什么情况下没申请到。我回答memory leak,
然后让我解释
memory leak。
然后让我用malloc申请一个100元素的int数组,问为啥sizeof(int)不直接写4.
然后问我都用过什么data structure,问hashtable用过没有,我说没有。然后问我
binary tree
和binary search tree区别。问binary search tree有重复怎么办,比如13445的
binary
search tree是什么,我说直接drop duplicate。search 复杂度是多少,平均和最坏情
况下。
最后让我问个问题,我问结果啥时候告我,他说一周。最后这个问问题阶段应该问
i**********e
发帖数: 1145
44
来自主题: JobHunting版 - 攒人品, Amazon电面
For question no. 6 (Binary tree serialization),
Writing the tree to a file is called 'serialization' and reading back from
the file to reconstruct the exact same binary tree is 'deserialization'.
You can use pre-order to traverse the tree one time to do the serialization.
The other method would be using a level-order traversal.
http://www.ihas1337code.com/2010/09/serializationdeserialization-of-binary.html
Question no. 12 you can either use 2 queues, currentLevel and nextLevel. Pop
nodes off cur... 阅读全帖
c**********e
发帖数: 2007
45
来自主题: JobHunting版 - C++ Q71: overloading (skillport)
When can binary operators be declared as member functions?
a) when the left argument of a binary operator is an object of that class.
b) when the right argument of a binary operator is an object of that class.
c) when both arguments of a binary operator is an object of that class.
E********a
发帖数: 124
46

coding, 要求
linear time的solution.
论过了),
可以参考原帖:
binary
search的变种找到10是9与14之间。那么,我们可以将矩阵给分成两个(请参考图片,
黄色与橙色
部分),然后分别在那两个小矩阵以再进行同样的搜索。
是:
感觉上差不多是O(N),worst case证明不容易,因为你每次做binary search的结果是
什么
position还真不好说,但是因为你可以换方向,比如这次选行,下次子问题里面可以根
据情况而选
中间列做binary search,所以我感觉应该是worst case也能达到O(N)的。
如果永远选择在长的方向做binary search,递归式严格的写,就是
T(N,M) = T(i, N/2) + T(N/2, N-i) + Log(M)
where M >= N, i<= N/2
还真不会证明这个式子的worst case
i**********e
发帖数: 1145
47
来自主题: JobHunting版 - Google的电面
第四题可以试试 binary search。
如果长度是1 billion,那么利用 binary search 大约 30 次左右就能知道那字在不在
词典里。
如果不知道长度的话,先利用 binary search 的方法找长度,然后之后再应用 binary
search 找该词是否在词典里。
一些常见面试题的答案与总结 -
http://www.ihas1337code.com

index
如果
g*****k
发帖数: 623
48
来自主题: JobHunting版 - 刚电面完,分享两个题目
Your solution is actually the same as ibread's solution.
in ibread's solutio's last step, j starts from n to 0, so binary search
in the sorted cum array s.t. cum[i]<= cum[j]-k. Once you find i, you just
get the smallest index by min_index[i].
min_index[i]= min{k | cum[k] j-min_index[i] is the length of the subarray starting at min_index[i]+1.

我今天写的代码,通过了我的一些随机数据测试(与 brute force 的方法进行比较)。
基于我上次贴的方法,有一些错误,造成一些混乱,不好意思。
1) First, we store the contiguous sum from the first element to a cumul... 阅读全帖
c*****c
发帖数: 188
49
来自主题: JobHunting版 - G面试题
4.When store the binary tree, store (a) structure encoding (b) data, which
is a list containing the content of each internal nodes
For encoding a binary tree, see
http://en.wikipedia.org/wiki/Binary_tree#Methods_for_storing_bi
DB contains that binary tree if it has a record of the exact encoding and
data of the that tree.
DB contains a variant of the binary tree if it has a record of the exact
encoding but the permutation of the data of that tree
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)