由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - Apple 电面
相关主题
an simple question about dynamic programming再问Amazon的card设计
问道题g家电面
Anyone knowing how to shuffle a deck of cards in Java?Randomly shuffle decks of cards
how to shuffle a deck of cards?[包子求助] Graph matching problem
报个T家的电面据吐槽一下某初创公司
[合集] 一道CS面试题下午电面MS
A Google ProblemGoogle电面面经 + onsite求祝福
java: use vector to shuffle a deck of Card 问题amazon的第二面
相关话题的讨论汇总
话题: deck话题: take话题: cards话题: problem话题: apple
进入JobHunting版参与讨论
1 (共1页)
f********y
发帖数: 120
1
今天apple电面,前后一共30分钟左右,问了问以前干过什么工作,自己介绍一下做过
的project
没问什么技术的问题。到最后问我会不会python,我说会,然后给发过来一道题,告诉我
send it back as soon as possible。打完电话立马开始写。
整体面试感觉还可以,至少没有被刁难
下面这个是给我发的考题,大家有兴趣可以试试
This module solves a coding problem that involves shuffling a deck of cards.
The problem description is as
follows:
You are given a deck containing n cards. While holding the deck:
1. Take the top card off the deck and set it on the table
2. Take the next card off the top and put it on the bottom of the deck in
your hand.
3. Continue steps 1 and 2 until all cards are on the table. This is around.
4. Pick up the deck from the table and repeat steps 1-3 until the deck is in
the original order.
Write a program to determine how many rounds it will take to put a deck back
into the original order. This
will involve creating a data structure to represent the order of the cards.
This program should be written in Python. It should take a number of cards
in the deck as a command line
argument and write the result to stdout.
b***e
发帖数: 1419
2
This programming question is quite non-trivial. I would be surprised if
this is a common interview question.
g*********s
发帖数: 1782
3
it's ok. as a math problem it's not trivial at all. but for coding the
problem description is very clear to understand.

【在 b***e 的大作中提到】
: This programming question is quite non-trivial. I would be surprised if
: this is a common interview question.

b***e
发帖数: 1419
4
That's what I'm saying. You can submit a program, but the input won't be
52(54), it might be 1M, then your program never stops. Then you're turned
down.
It is not fair to ask such a question in merely an interview of software
engineer. I question if the interviewer even knows how to do it well, and
I guess 99% of the existing Apple engineers, in whatever level, couldn't
finish this within 30 mins (that could handles huge input).

【在 g*********s 的大作中提到】
: it's ok. as a math problem it's not trivial at all. but for coding the
: problem description is very clear to understand.

g*****n
发帖数: 37
5

诉我
cards.
1. calculate the place mapping in a single round. e.g., 0,1,2,3,4 -> 1,3,4,2
,0. O(n)
2. for each card, calculate how many rounds it takes to return to the
original place. O(n*n)?
3. calculate least common multiple of the results returned in step 2. O(n*
LCD_complexity)

【在 f********y 的大作中提到】
: 今天apple电面,前后一共30分钟左右,问了问以前干过什么工作,自己介绍一下做过
: 的project
: 没问什么技术的问题。到最后问我会不会python,我说会,然后给发过来一道题,告诉我
: send it back as soon as possible。打完电话立马开始写。
: 整体面试感觉还可以,至少没有被刁难
: 下面这个是给我发的考题,大家有兴趣可以试试
: This module solves a coding problem that involves shuffling a deck of cards.
: The problem description is as
: follows:
: You are given a deck containing n cards. While holding the deck:

1 (共1页)
进入JobHunting版参与讨论
相关主题
amazon的第二面报个T家的电面据
Amazon 电面[合集] 一道CS面试题
Amazon On-site ,kindle组有什么要特别注意的地方么?+前两轮电面面经A Google Problem
电面thank you letter?java: use vector to shuffle a deck of Card 问题
an simple question about dynamic programming再问Amazon的card设计
问道题g家电面
Anyone knowing how to shuffle a deck of cards in Java?Randomly shuffle decks of cards
how to shuffle a deck of cards?[包子求助] Graph matching problem
相关话题的讨论汇总
话题: deck话题: take话题: cards话题: problem话题: apple