avatar
windows could not boot# Hardware - 计算机硬件
j*x
1
1. 给一个字符串,将其中的单词全部反转,如hello world=>olloeh dlrow
2. singleton class,给出一个thread safe并且exception safe的实现
3. 算法题(不用写代码),一个整数数组,其中有一个数只出现一次,其余都
出现两次,找出只出现
一次的数;然后扩展一下,有一个数只出现一次,其余都出现三次,找出只出现
一次的数
向他提问,确认一下Palantir都是用java的。
avatar
d*e
2
好像是:
Department of Homeland Security
United States Citizenship and Immigration Services
Nebraska Service Center
P.O. Box 87140
Lincoln, NE 68501-7140
但我在michigan,不是说材料会送往 Texas或者是NY 这两个中心吗?这样子的话,上面
的地址不对,是吗?
avatar
a*t
4
Boot loop. Safe mode or F9 won't help.
How to debug? Thanks!
avatar
c*o
5
最后一题的后面一个,出现3次有什么快的技巧吗
avatar
f*D
6
我都不写地址了
不知道有没有问题
avatar
t*y
7
士别三日,当。。。。。
avatar
a*o
8
我去你这也太缺乏细节了,想帮忙都木法回答啊。
不过你这个基本上是某个component坏掉了,你没有零件一个个换下来测试的话就老老
实实换机器最省事。

【在 a**********t 的大作中提到】
: Boot loop. Safe mode or F9 won't help.
: How to debug? Thanks!

avatar
v*n
9
online coding interview多长时间?
avatar
d*3
10
这个无所谓的, 或者只写成
Department of Homeland Security
United States Citizenship and Immigration Services
avatar
D*3
11
有硬盘的话换个硬盘试试.........
avatar
j*x
12
很多办法都可以
最简单的hashing
另一种是用quicksort的partition,每次看两边sub array的长度n,找到n满足n%3==1
,然后这个数一定在这一边,O(n)

【在 c******o 的大作中提到】
: 最后一题的后面一个,出现3次有什么快的技巧吗
avatar
O*O
13
只接电源主板内存显卡显示器
最小系统启动看看
avatar
j*x
14
40-50
跟一般面试一样

【在 v***n 的大作中提到】
: online coding interview多长时间?
avatar
B*y
15
最近有没有装什么新硬件?从最新装的,或是最不重要的硬件开始,一个一个往下拆,
看能不能启动。。。

【在 a**********t 的大作中提到】
: Boot loop. Safe mode or F9 won't help.
: How to debug? Thanks!

avatar
h*n
16
2nd one is nice.

1

【在 j********x 的大作中提到】
: 很多办法都可以
: 最简单的hashing
: 另一种是用quicksort的partition,每次看两边sub array的长度n,找到n满足n%3==1
: ,然后这个数一定在这一边,O(n)

avatar
h*n
17
all three need complete code? if so it's challenging.

【在 j********x 的大作中提到】
: 40-50
: 跟一般面试一样

avatar
j*x
18
修改了一下,我默认算法题指的不是coding的题目。最后一个算法题不要写代码的,其
实写起来也不算难

【在 h*********n 的大作中提到】
: all three need complete code? if so it's challenging.
avatar
c*o
19
nice。这也可以,真是什么方法都想得到啊

1

【在 j********x 的大作中提到】
: 很多办法都可以
: 最简单的hashing
: 另一种是用quicksort的partition,每次看两边sub array的长度n,找到n满足n%3==1
: ,然后这个数一定在这一边,O(n)

avatar
h*n
20
yes, it's not hard. but given 45-min window, complete three with bug free is
hard, unless you have practiced them before.
anyway, it seems you did well. cong.

【在 j********x 的大作中提到】
: 修改了一下,我默认算法题指的不是coding的题目。最后一个算法题不要写代码的,其
: 实写起来也不算难

avatar
r*y
21
if the array is 1 2 2 3 3
then 1^2^2^3^3 = 1
can we apply similiar idea to 1 2 2 2 3 3 3 ?

【在 j********x 的大作中提到】
: 1. 给一个字符串,将其中的单词全部反转,如hello world=>olloeh dlrow
: 2. singleton class,给出一个thread safe并且exception safe的实现
: 3. 算法题(不用写代码),一个整数数组,其中有一个数只出现一次,其余都
: 出现两次,找出只出现
: 一次的数;然后扩展一下,有一个数只出现一次,其余都出现三次,找出只出现
: 一次的数
: 向他提问,确认一下Palantir都是用java的。

avatar
j*x
22
我以前看到别人这种做法,做面试题如同应试。。。

【在 c******o 的大作中提到】
: nice。这也可以,真是什么方法都想得到啊
:
: 1

avatar
j*x
23
I dont understand, xor does not work for number appears 3 times. There is no
similar approach to XOR works for 3 appearance.

【在 r*******y 的大作中提到】
: if the array is 1 2 2 3 3
: then 1^2^2^3^3 = 1
: can we apply similiar idea to 1 2 2 2 3 3 3 ?

avatar
D*h
24
多谢分享。
他家是只能用Java么? 有没有问java细节题?
第一次那个电话面试只说算法,不用把code念给他听?

【在 j********x 的大作中提到】
: 1. 给一个字符串,将其中的单词全部反转,如hello world=>olloeh dlrow
: 2. singleton class,给出一个thread safe并且exception safe的实现
: 3. 算法题(不用写代码),一个整数数组,其中有一个数只出现一次,其余都
: 出现两次,找出只出现
: 一次的数;然后扩展一下,有一个数只出现一次,其余都出现三次,找出只出现
: 一次的数
: 向他提问,确认一下Palantir都是用java的。

avatar
j*x
25
一面有一个简单的题目是要求念code的,其他2-3个题目都是算法题,给出思路
即可;
任何语言都可以,除非非常偏门
不考语言细节
他们开发绝大部分是java,这根面试没有关系
二面还是可以挑任何语言(我的面试官基本不动c/c++)

【在 D***h 的大作中提到】
: 多谢分享。
: 他家是只能用Java么? 有没有问java细节题?
: 第一次那个电话面试只说算法,不用把code念给他听?

avatar
l*y
26
singleton class,给出一个thread safe并且exception safe的实现
请问这个怎么写? thread safe用double check的方法就好了,exception safe那?

【在 j********x 的大作中提到】
: 1. 给一个字符串,将其中的单词全部反转,如hello world=>olloeh dlrow
: 2. singleton class,给出一个thread safe并且exception safe的实现
: 3. 算法题(不用写代码),一个整数数组,其中有一个数只出现一次,其余都
: 出现两次,找出只出现
: 一次的数;然后扩展一下,有一个数只出现一次,其余都出现三次,找出只出现
: 一次的数
: 向他提问,确认一下Palantir都是用java的。

avatar
j*x
27
上锁呗
avatar
j*x
28
上锁呗
avatar
j*x
29
RAII
avatar
l*y
30
看了wiki上的介绍,还算理解。
请问是下面这样吗?谢谢
class Singleton {
Singleton* GetInstance() {
if (! instance) {
pthread_mutex_lock();
if (! instance) {
instance = new Singleton();
}
pthread_mutex_unlock();
}
}
~Singleton() {
pthread_mutex_unlock();
}
private:
Singleton(){};
static Singleton* instance;
};
Singleton* Singleton::instance = NULL;
但是如果Singleton destructor被正常调用,pthread mutex这时是没有lock的
可以unlock吗?

【在 j********x 的大作中提到】
: RAII
avatar
l*i
31
This one is a bit strange. Since sorting gives O(nlogn) trivially.
Use partition with randomization will give O(n) in expected time. If you use
O(n) time algorithm to find median and do partition, then it is worst case
O(nlogn).
hashing is a bit cheating in my opinion. If you are allowed hashing, then
you can solve the problem with one element appear once and the other
elements can appear any number of two or more times. This defeats the
purpose of other elements appear exactly 3 times.

1

【在 j********x 的大作中提到】
: 很多办法都可以
: 最简单的hashing
: 另一种是用quicksort的partition,每次看两边sub array的长度n,找到n满足n%3==1
: ,然后这个数一定在这一边,O(n)

avatar
h*n
32
为何dtor里解锁?没必要吧。
另外其实最简单的做法是在全局直接初始化:
Singleton::instance = new Singleton;

【在 l*********y 的大作中提到】
: 看了wiki上的介绍,还算理解。
: 请问是下面这样吗?谢谢
: class Singleton {
: Singleton* GetInstance() {
: if (! instance) {
: pthread_mutex_lock();
: if (! instance) {
: instance = new Singleton();
: }
: pthread_mutex_unlock();

avatar
l*y
33
大哥,你这方法可以在面试里讲吗?

【在 h*********n 的大作中提到】
: 为何dtor里解锁?没必要吧。
: 另外其实最简单的做法是在全局直接初始化:
: Singleton::instance = new Singleton;

avatar
h*n
34
why not? it's a discussion, not a standard test.

【在 l*********y 的大作中提到】
: 大哥,你这方法可以在面试里讲吗?
avatar
f*5
35
u need to declare ctor as public if u want to do so
then everyone can call it to instantiate a new object

【在 h*********n 的大作中提到】
: 为何dtor里解锁?没必要吧。
: 另外其实最简单的做法是在全局直接初始化:
: Singleton::instance = new Singleton;

avatar
h*n
36
how about this?
Singleton::instance = getSingleton()

【在 f*********5 的大作中提到】
: u need to declare ctor as public if u want to do so
: then everyone can call it to instantiate a new object

avatar
f*5
37
maybe it is better to add a
static void DeleteInstance()
then use the same logic to call below
delete instance;

【在 l*********y 的大作中提到】
: 看了wiki上的介绍,还算理解。
: 请问是下面这样吗?谢谢
: class Singleton {
: Singleton* GetInstance() {
: if (! instance) {
: pthread_mutex_lock();
: if (! instance) {
: instance = new Singleton();
: }
: pthread_mutex_unlock();

avatar
j*x
38
Lazy initialization is needed
Hmm, don't miss the point here, it's a discussion to showcase your knowledge
, not your ignorance....

【在 h*********n 的大作中提到】
: why not? it's a discussion, not a standard test.
avatar
j*x
39
Hmm, think again...

use
case

【在 l***i 的大作中提到】
: This one is a bit strange. Since sorting gives O(nlogn) trivially.
: Use partition with randomization will give O(n) in expected time. If you use
: O(n) time algorithm to find median and do partition, then it is worst case
: O(nlogn).
: hashing is a bit cheating in my opinion. If you are allowed hashing, then
: you can solve the problem with one element appear once and the other
: elements can appear any number of two or more times. This defeats the
: purpose of other elements appear exactly 3 times.
:
: 1

avatar
h*n
40
why lazy init is needed? what's the expense to init one in advance?
if the expense of lazy init is having a lock, it's hard to say if lazy is
worth.
the discussion is not only to show what you learn from the textbook but also
your analysis and understanding. it's an "interview", not an exam.

knowledge

【在 j********x 的大作中提到】
: Lazy initialization is needed
: Hmm, don't miss the point here, it's a discussion to showcase your knowledge
: , not your ignorance....

avatar
h*n
41
expected O(n) good enough. but it would be perfect to point out the worst
case.

【在 j********x 的大作中提到】
: Hmm, think again...
:
: use
: case

avatar
j*x
42
windows8 一大亮点是开机速度快。。。
减少initialization时间对提高app启动时间很有帮助。。。

also

【在 h*********n 的大作中提到】
: why lazy init is needed? what's the expense to init one in advance?
: if the expense of lazy init is having a lock, it's hard to say if lazy is
: worth.
: the discussion is not only to show what you learn from the textbook but also
: your analysis and understanding. it's an "interview", not an exam.
:
: knowledge

avatar
j*x
43
面试官和我对partition的worst case以及如何优化有很明显的共识,实际上大家都知
道,不讲而已。基本上已经是常识性的东西了。

【在 h*********n 的大作中提到】
: expected O(n) good enough. but it would be perfect to point out the worst
: case.

avatar
h*n
44
then what would you think about again?

【在 j********x 的大作中提到】
: 面试官和我对partition的worst case以及如何优化有很明显的共识,实际上大家都知
: 道,不讲而已。基本上已经是常识性的东西了。

avatar
j*x
45
不好意思我看错了

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