由买买提看人间百态

topics

全部话题 - 话题: careercup
1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
A******g
发帖数: 612
1
来自主题: JobHunting版 - careercup 150 4.1 balanced tree 有错?
题目:判断一个binary tree 是否平衡,平衡的定义是任意node,左边subtree和右边
subtree的高度相差不超过1。Careercup150有这道题,用了书上的解法。没有通过全部
测试。觉得careercup解法好像不对。
比如这个
{1,2,3,4,5,#,6,7}
1
/ \
2 3
/\ \
4 5 6
/
7
Careercup是用max depth - min depth = 3-1=2 不平衡
主要是上面的minDepth算法会把1右边substree算成2
请大牛指点!
careercup书上解法:
/**
* Definition for binary tree
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(... 阅读全帖
B*****t
发帖数: 335
2
来自主题: JobHunting版 - 大家怎么学习careercup上面的题目的
先看careercup的书,有时间上careercup的网站上看看。不过感觉上面重复的题很多,
有很多算法题的解法有误导的嫌疑,而且看起来很浪费时间,效率太低。我感觉还没有
mitbbs的精华区好,很快就可以过一遍前人总结的东西。
s*********s
发帖数: 318
3
来自主题: JobHunting版 - 求careercup第四版
http://www.careercup.com/book
The Official CareerCup Book: Cracking the Coding Interview, 4th Edition
感觉第三版还是有一些错误。希望第四版会有改进。
A*********r
发帖数: 564
4
原题如下:
Imagine you have a square matrix, where each cell is filled with either
black or white. Design an algorithm to find the maximum subsquare such that
a ll four borders are filled with black pixels.
http://careercup.com/question?id=2445
大家都知道这是那道找全部为1的最大子方阵的变形(用DP可以达到O(N^2)),可是这道
题却不太能用那道题的方法,从optimal subproblem 无法得到下一个最优解。
CareerCup上给出了一种答案,也就是找出每一个可能的子方阵,然后测试它的四个边
是否满足条件。。这个首先不是DP, 另外他claim算法复杂度是O(N^2), 可是我怎么看
着像O(N^3),因为每找出一个子方阵,需要O(N^2), 但是对每一次方阵进行测试,也是
需要最坏O(N)的,请大家讨论讨论。。
给个例子
1 1 1 1 1
f**********t
发帖数: 1001
5
一道常考的题是design a library system。careercup里面的book reader system与其
类似,
public class Book
{
ID;
details;
private static Set books;
……
}
public class User
{
……
private static Set users;
}
另外有一个public class OnlineReaderSystem。
其中我们发现Book类和User类里面都有一个Set。是这种design方法好,还是把这两个
Set都放到OnlineReaderSystem的class好?
另外感觉CareerCup的这个解法不是很方便实现一个用户的借书/读书。是不是每个User
都有一个booklist比较好?
P**********c
发帖数: 3417
6
这个用了递归,没看出比careercup上的好在哪儿。这道题careercup上用的就是标准解法,跟CLRS上的一样。
w***y
发帖数: 6251
7
我就是自己做了一个main部分测试了一下, 其他部分都是copy书上的
import java.util.Comparator;
import java.util.PriorityQueue;

public class heap {
/*
* careercup里答案部分
*/
private Comparator maxHeapComparator, minHeapComparator;
private static PriorityQueue maxHeap;
private static PriorityQueue minHeap;
public static void addNewNumber(int randomNumber) {
if (maxHeap.size() == minHeap.size()) {
if ((minHeap.peek() != null) && randomNumber > minHeap.peek()) {... 阅读全帖
w*****t
发帖数: 485
8
来自主题: JobHunting版 - 大家看不看careercup啊?
1) 《careercup 150》
2) 本版面经
3) leetcode.com
4) glassdoor面经
5) ...
我觉得按这个来,应该足够了,至少能有个800题~
careercup.com感觉回答质量不高,可以作为补充。
s*******u
发帖数: 89
9
来自主题: JobHunting版 - 【已组好】求组队刷CareerCup&LeetCode
如题
多谢万能的mitbbs。祝大家新年都收到好offer。加油加油!
===================================================
硅谷某著名码农生产基地的大四小妞一枚,主修CS,辅修Math。比较擅长的语言是C/C+
+, 各类学校不教的网页编程语言和文言文。Java小弱。常规出没地为家,学校,马丁
路德金图书馆(对!就是San Jose downtown那个)。中度多动症患者,资深拖延症战
士,一个人看书的时候就看看美剧刷刷豆瓣次次零食一天就过去了啊!!
计划是三月中旬前要刷三遍CareerCup+两遍LeetCode。
目前的进度是CareerCup第一遍走到2/3。鉴于自己的注意力不集中症已病入膏肓,遂发
一帖看看有木有各路大侠也在刷题,可以组队去图书馆杀boss滴。
S*******n
发帖数: 1867
10
【 以下文字转载自 InterviewHackers 俱乐部 】
发信人: SunnyOpen (新工作,fighting!), 信区: InterviewHackers
标 题: Free Career books and Video on www.careercup.com
发信站: BBS 未名空间站 (Mon Apr 26 21:45:13 2010, 美东)
书在这里
http://www.box.net/shared/c7arm86blt
one survey need to be finished. The survey takes no more than five minutes
unless you have a lot to say to careercup.com :)
today only.
c***g
发帖数: 472
11
来自主题: JobHunting版 - 大家怎么学习careercup上面的题目的
我看了一下careercup上的题目, 整个结构很乱啊, 比如算法就有700多道, 但是, 没有
一个很好的索引, 我今天看了的题目, 可能明天就不知道又从哪儿开始看了. 另外, 怎
么从上面找到那种回答已经很成熟的题目? 大家都是怎么学习的,谢谢了.
z***e
发帖数: 5393
12
你在careercup上也这个id?
s*****0
发帖数: 113
13
来自主题: JobHunting版 - careercup上amazon的题目
LZ是买了careercup的书吗?想问一下有没有用?值得买吗?
m*******r
发帖数: 202
14
也能给我一份吗 多谢啊
y*****[email protected]

20Related/CareerCup%5E_Top%5E_150%5E_Questions.pdf
m***t
发帖数: 21
15
可以给我发一份吗?谢谢!
q***[email protected]

b916d8fe662a1f2f.skydrive.live.com/self.aspx/Interview%20Related/CareerCup
%5E_Top%5E_150%5E_Questions.pdf
k******8
发帖数: 913
16
来自主题: JobHunting版 - 跪求一个careercup的ebook PDF
希望哪位有careercup "Cracking the technical interview"ebook PDF的大大能够发
给我一份。
d****[email protected]
不胜感激啊。一定包子答谢!
l*********y
发帖数: 142
17
来自主题: JobHunting版 - 问一道google面试题(from careercup)
given an array of n elements, find if there is a subset of 3 elements sum up
to value T with time complexity O(nlgn).
感觉这道题定义很清晰,但是只能想出O(n^2*lgn) 的brute force解法.
careercup上的讨论不清楚。谢谢。
a***9
发帖数: 364
18
来自主题: JobHunting版 - 问一道google面试题(from careercup)
这个做法是错的~
发信人: amoi9 (amoi), 信区: JobHunting
标 题: Re: 问一道google面试题(from careercup)
发信站: BBS 未名空间站 (Sun Apr 11 22:34:54 2010, 美东)
Thanks for back up..
z*********3
发帖数: 37
19
来自主题: JobHunting版 - 问一个careercup上的题目
O(N)不可能吧。。。我怎么没在careercup上发现有这么一段话
I**A
发帖数: 2345
20
来自主题: JobHunting版 - 求CareerCup电子书...
受不了你们了
版本查询一下就能找到啊。。。
keyword careercup
days 360
no followups..
here is the link..
http://www.mitbbs.com/article/JobHunting/31504591_3.html
K******g
发帖数: 1870
21
8.7 Given an infinite number of quarters (25 cents), dimes (10 cents),
nickels (5 cents) and pennies (1 cent), write code to calculate the number
of ways of representing n cents.
好像careercup上的答案不对,请大家有什么好的方法吗?
K******g
发帖数: 1870
22
来自主题: JobHunting版 - 请教careercup上的一道题
请问有谁看懂了这道题
A circus is designing a tower routine consisting of people standing atop one
another’s
shoulders. For practical and aesthetic reasons, each person must be both
shorter and
lighter than the person below him or her. Given the heights and weights of
each person
in the circus, write a method to compute the largest possible number of
people in such
a tower.
我没有看懂careercup上的解答,请问谁能详细点给出答案呢,多谢了
l*****v
发帖数: 498
23
来自主题: JobHunting版 - careercup上这道题我竟然没看懂
Given two arrays A & B of length l, containing non negative integers, such
that the sum of integers in A is the same as sum of integers in B.( The
numbers need not be the same in both the arrays.)
Now if you start with an index 'k' in each array and do the following
summation, SUMMATION (Ak-Bk), where Ak is the value at index k of array A,
and Bk is the value at index k of array B, where 'k' increments and wraps
back all the way to k-1, the final sum value will be zero.
Question: Find a suitable... 阅读全帖
V*****i
发帖数: 92
24
来自主题: JobHunting版 - 抛砖引玉:Careercup 150题中的错误
记得很久以前,我还没有开始准备面试的时候,一个人曾经发贴说过虽然Careercup
150这本书用来准备面试很不错,可以看到很多常见的题目,但要注意里面的解答有很
多错误。可惜当时没细问。
想问下看过这本书的人,你们注意到哪些错误了,拿出来交流一下。我先来说一个:
Problem 2.2,当n比链表的长度正好大1的情况下,会出错。
b*******s
发帖数: 5216
25
来自主题: JobHunting版 - 抛砖引玉:Careercup 150题中的错误
哪里有free的careercup 150下载?
谢谢
f*******4
发帖数: 1401
26
来自主题: JobHunting版 - 问一个CareerCup上的Google题
CareerCup上有不少题都是有些云里雾里
d***k
发帖数: 3225
27
自己买的,发出来大家share
小弟最近也在找工作,多攒点rp,希望能有好offer
要是违反知识产权或者各种相关法律条款的,还请高人见谅,不要吓唬小弟。
http://u.115.com/file/t56f8ea927#
careercup_movie.mp4
提取码:t56f8ea927
http://u.115.com/file/t5a23750d8#
careercup+interview+with+alexey+-+t9+auto-completion.m4v
提取码:t5a23750d8
http://u.115.com/file/t5e6e723b2#
interview+with+jon%3a+largest+increasing+subsequence+in+an+array
提取码:t5e6e723b2
http://u.115.com/file/t5717e8c63#
interview+with+scott%3a+implement+%27getnextnode%27+in+a+binary+search+tre
e
提取码:t5717e8c63
d***k
发帖数: 3225
28
就是careercup的作者找了几个upenn的学生模拟on-site面试
然后点评一下
j***y
发帖数: 2074
29
http://u.115.com/file/t5a23750d8#
careercup+interview+with+alexey+-+t9+auto-completion.m4v
没有源了。
s******d
发帖数: 61
30
careercup果然囧.....还是学校ppt好!
public E successor(E x){
return succAux(root, x, null);
}
private E succAux(Node t, E x, E best){
if(t==null)
return best;
int c=x.compareTo(t.v);
if(c<0)
return succAux(t.l, x, t.v);
else return succAux(t.r, x, best);
}
The last left turn is the successor(X).
k*j
发帖数: 153
31
来自主题: JobHunting版 - careercup书上一道题:判断直线相交
careercup那本书上一道题。
10.3 Given two lines on a Cartesian plane, determine whether the two lines
would intersect.
书里是用slope来做。
return abs(line1.slope-line2.slope)>esp || abs(line1.yintercept - line2.
yintercept) < esp
但明显这没有考虑slope infinite的情况。所以不是很好的solution.
想问问这题有没有更general的解法呢?多谢!
G****A
发帖数: 4160
32
从CSDN下载的CareerCup 150。2008版,4th版都有。结果看了几行,发现里面的code很
多错的,即使不错,看起来也很别扭。怎么回事啊?
比如,create a linkedList,它给的code:
--------------------
class Node {
Node next = null;
int data;
public Node(int d) { data = d; }
void appendToTail(int d) {
Node end = new Node(d);
Node n = this;
while (n.next != null) { n = n.next; }
n.next = end;
}
}
--------------------
下面是Algorithm in C++里的code:
----------------
struct node
{ Item item; node *next;
node (Item x; node *t)
{ ite... 阅读全帖
l******l
发帖数: 66
33
While CareerCup does have bugs in its codes, but I don't see anything wrong
with the linked list code above, it just presents it in a different way.
y*******g
发帖数: 6599
34
glassdoor, 质量远远高于careercup
s**********s
发帖数: 17
35
来自主题: JobHunting版 - careercup
大家好,谁有Careercup C++编程文件可以分享?多谢!
B******5
发帖数: 4676
36
来自主题: JobHunting版 - 看不懂careercup上一题的答案
有时间的话把careercup上的题目自己写写比较好,
好记性不如烂笔头,当然这也是给我自己说。。。
d********t
发帖数: 9628
37
你下午才跟我说Cracking就是CareerCup
p*****2
发帖数: 21240
38
来自主题: JobHunting版 - 感觉careercup上的mergesort很不简洁

可以。看来interview exposed和careercup上的sample code还是有很多可以改进的地
方呀。
w********p
发帖数: 948
39
来自主题: JobHunting版 - Careercup 150总结
我从益友上看到这个帖子,然后 google "Careercup 150总结", 到了这里。
看到的正是时候。
w********p
发帖数: 948
40
来自主题: JobHunting版 - Careercup 150总结
我从益友上看到这个帖子,然后 google "Careercup 150总结", 到了这里。
看到的正是时候。
n**********2
发帖数: 214
41
来自主题: JobHunting版 - careercup vs leetcode
RT,用过的不妨谈谈感觉,哪个网站更实用一些?我听说的是careercup越来越商业化
,做的不好?
l*y
发帖数: 21010
42
来自主题: JobHunting版 - careercup vs leetcode
我感觉careercup有些代码不太对
leetcode比较好
不过题目应该都做做吧
S**********e
发帖数: 503
43
来自主题: JobHunting版 - 问下careercup上的这一题
http://www.careercup.com/question?id=14552712
“Given a number , say 263 , is said to be colorful if the product of all
its substrings is unique . 2 , 6 , 3 , 6*3 , 2*6 .But 2*3 is NOT a valid
product . We have to consider substring only. Tell whether the number is
colorful or not”
我看了半天没看懂题目意思。是不是说求一个string的所有substring,然后两两相乘
,如果所有结果都不一样,那说明这个string是colorful的?
l******d
发帖数: 530
44
来自主题: JobHunting版 - careercup上这题是什么意思
http://www.careercup.com/question?id=12402058
看得我一头雾水
“There is a game they termed as Mingo. A random generator (like a speaker
standing in a group housie game calls out a number) generates out any number
from 1 to 1000.
There is a 10X10 matrix. A random generator assigns values to each block of
this matrix(within 1 to 1000 obviously).
Whenever, a row or a column or a diagonal is fully filled in this 10x10 from
the numbers called out by the speaker, its called a 'Mingo'.
Write a program that wil... 阅读全帖
h*******e
发帖数: 1377
45
来自主题: JobHunting版 - leetcode跟careercup是互补的吗?
恩。 感覺不少careercup不好測試的題在leetcode上都有相應題目的測試數據。
x*********s
发帖数: 2604
46
来自主题: JobHunting版 - 做了一个中文版careercup
做了一个中文山寨版careercup给各位老中服务,www.youaregeek.com,刚做好,大家
多捧场哈,多写点面试题。谢谢支持!
目前还在测试阶段,以后会慢慢放上去一些现成的题目作为题库。
x*********s
发帖数: 2604
47
来自主题: JobHunting版 - 做了一个中文版careercup
careercup题库已导入
b*********h
发帖数: 103
48
就现在的面试题来看 很多是 acm 题 而这种难度的题在比赛里几分钟就可以被搞出来
所以说是水题
可能楼主是想说,做 leetcode 和 careercup 并没有提升算法功底,因为面试题问的
都挺直接,并没涉及什么算法 所以不建议拿这些准备
其实觉得准备面试还是做这些好了 拿到好 offer 确实有过人之处 只是未必是算法学
好了 搞过竞赛准备面试题还是很便利的
s*****1
发帖数: 134
49
CareerCup (第四版)中4.9:
You are given a binary tree in which each node contains a value. Design an
algorithm to print all paths which sum to a given value. Note that a path
can start or end anywhere in the tree.
关于这一题,我认为:
1. 我觉得答案不对。既然是任何两点的path,那么左树和右树的任何两点之和也算,但
是答案不算这种情况。
2. 如果是我说的那种左树和右树都算的情况,我知道也可以按照path的顶点(depth最
小点)进行recursion,但如果这样做,我想不出一个极其高效的做法。根据我的判断,
这题至少要O(n^3)的时间,而且space也是不efficient的。
想问各大牛,有没有高效的做这题的方法? 非常感谢~
x*******6
发帖数: 262
50
careercup上的解法好像只能找出从ancester-->current node这样的path
1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)