Apple 电面# JobHunting - 待字闺中
f*y
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.
的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.