Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"The Social Network" programming puzzle

There's a neat sequence in the movie The Social Network in which the character writes a perl script to grab images from sorority web servers on campus. His goal is to get a picture for every member of each sorority with a minimum of missed members. Typically, this just involves him grabbing it from a public directory or other little hoops like an empty search which returns all members, but he describes one really interesting set up and never gives a solution for it.

One sorority's site allows for searching and returns the pictures for matching members. However, if a search returns more than 20 matches, nothing is displayed.

Assuming no other way to access the pictures and without a list of the names of sorority members, is there an elegant way to get at least a majority of member pictures in this case? Or any way at all?

Edit: Here's a link to the scene from the movie, slightly cut up to show only the coding parts.

like image 239
Sean Avatar asked Dec 03 '22 02:12

Sean


2 Answers

Pick up the phone, ask for a campus directory and feed those names into the sorority's search to get members back one at a time.

This is, after all, the social network.

like image 179
Schwern Avatar answered Dec 18 '22 12:12

Schwern


I haven't seen the movie, but let me state some assumptions:

  • You have a search field which searches by name.
  • You don't know the names of any sorority members.
  • There is no other way to access the pictures (except the search box).

In this scenario, I do not think there is an elegant answer. This may be one of those cinematic "I translate the ancient tablet in an unknown language" sort of moments. My guess is your best bet would be a brute-force search.

  1. If you search by common names (and last names), you could get a majority of the members.
  2. If you have the time and will, an actual brute force (letter by letter, etc) would eventually fill up the gaps missed by item 1.

Edit: Also, in theory, if the sorority is large enough and everyone is named "Jane Smith", there would be no solution.

like image 34
user664939 Avatar answered Dec 18 '22 13:12

user664939