Vous êtes sur la page 1sur 5

Top of Form

Suggestions, ideas, bug reports, and comments are always welcome. If you'd like to interact with
other Dropbox users, check out our forums.

Email Address (optional)

Submit

Bottom of Form
There was a problem completing this request.

Request completed successfully.

• Log in
Top of Form

791206fc33

Email

Password

Remember me
Log in

Create an account
Bottom of Form

Back to home
Test your might
We get a lot of interest in working at Dropbox but it's not always easy to tell how a person's
brain works from a resume. If you're like us, you love a good puzzle. That's why this page is
here! It's a great way to share why we love working at Dropbox: innovative thinking, a bit of
elbow grease, and some good fun. Who knows? If you knock these puzzles out of the park, we'll
have something to talk about when you come in.

Send all submissions to challenges@dropbox.com. The subject line should match the puzzle
name.

Packing your Dropbox


Try to pack your "files" into as small a "Dropbox" as possible.

File Events
Turn Dropbox file changes into human-readable events feed.
Packing your Dropbox
When you're working with petabytes of data, you have to store files wherever they can fit. All of
us here at Dropbox are always searching for more ways to efficiently pack data into smaller and
more manageable chunks. The fun begins when you bend the rules a little bit and visualize it in
two dimensions.
You'll be given a list of rectangular "files" that you'll need to pack into as small a "Dropbox" as
possible. The dimensions of each file will be specified by a tuple (width, height), both of
which will be integers. The output of your function should be the area of the smallest rectangular
Dropbox that can enclose all of them without any overlap. Files can be rotated 90° if it helps.
Bonus points if you can draw pictures of the winning configurations along the way. While
drawing pictures, any files sharing dimensions should be considered identical/interchangeable.
Your program must read a small integer 1 <= N <= 100 representing the maximum number of
files to consider, followed by the width and height of each file, one per line. Output should
simply be the area of the smallest containing Dropbox. If you want to print pretty pictures, send
that to stderr. Only the output on stdout will be judged.
Sample Input Sample Output
3 88
8 8
4 3
3 4

Sample Output (stderr, optional)


11x8:
+ - - - - - - + + - +
| | | |
| | | |
| | + - +
| | + - +
| | | |
| | | |
+ - - - - - - + + - +

8x11:
+ - - - - - - +
| |
| |
| |
| |
| |
| |
+ - - - - - - +
+ - - + + - - +
| | | |
+ - - + + - - +
11x8:
+ - + + - - - - - - +
| | | |
| | | |
+ - + | |
+ - + | |
| | | |
| | | |
+ - + + - - - - - - +

8x11:
+ - - + + - - +
| | | |
+ - - + + - - +
+ - - - - - - +
| |
| |
| |
| |
| |
| |
+ - - - - - - +

File Events
To keep all your computers in sync, Dropbox watches your filesystem for any changes within
your Dropbox folder. Unfortunately, in many cases the file events received are too coarse to be
presentable to non-savvy users: an ADD event for any new file and a DEL event for any file that
went missing.
You'll be given a list of ADD/DEL file events that should be processed and turned into a human-
readable file event feed that includes richer events like file and directory renames, moves, and
copies.
Your program must read an integer 1 <= N <= 50000 representing the number of file events in
the test file, followed by that many file event rows. Each row will have, separated by spaces: the
file event type, a UNIX timestamp of when the event occurred, the path of the file relative to the
Dropbox root, and a 8-character hash of the contents (or former contents) of the file. No file
paths will include spaces. Directories are files too, and may be empty (they'll have "-" as their
file hash).
Your output should be a series of English sentences, one per line, in some way describing the file
events in a user-friendly manner. There is no objectively 'right' answer here, and in fact there
may be multiple ways to interpret a provided list of file events. We'll be judging submissions on
a number of criteria including raw efficiency, friendliness of output, ability to handle ambiguity,
and more. As one example, the sample output below is (probably) the correct interpretation of
the input file events, but is not particularly user-friendly. Feel free to deviate substantially from
the sample.
Sample Input Sample Output
6 Added dir /test.
ADD 1282352346 /test - Added file /test/1.txt.
ADD 1282353016 /test/1.txt f2fa762f Renamed dir /test -> /test2.
DEL 1282354012 /test -
DEL 1282354012 /test/1.txt f2fa762f
ADD 1282354013 /test2 -
ADD 1282354013 /test2/1.txt f2fa762f

© 2010 Dropbox
• Dropbox
• Home
• Install
• Mobile
• Pricing
• Features
• Tour
• Community
• Referrals
• Twitter
• Facebook
• Wiki
• Developers
• Partners
• Support
• Help Center
• Forums
• Votebox
• Feedback
• Contact Us
• About Us
• Dropbox Blog
• Our Team
• Press
• Policies
• Jobs

Vous aimerez peut-être aussi