Skip to content

Instantly share code, notes, and snippets.

@ndisampson
Last active July 28, 2020 17:07
Show Gist options
  • Save ndisampson/fb67d0ac76f7b313384dc8110f1adbf4 to your computer and use it in GitHub Desktop.
Save ndisampson/fb67d0ac76f7b313384dc8110f1adbf4 to your computer and use it in GitHub Desktop.

Revisions

  1. ndisampson revised this gist Jul 28, 2020. No changes.
  2. ndisampson revised this gist Jul 28, 2020. 1 changed file with 0 additions and 20 deletions.
    20 changes: 0 additions & 20 deletions secret_santa.md
    Original file line number Diff line number Diff line change
    @@ -1,20 +0,0 @@
    ### Problem 1: Implement a Secret Santa Matching Algorithm



    The algorithm should take a set of names and return a set of pairs of names chosen randomly as follows:


    * Each person’s name is put in “a hat”.

    * Each person randomly draws a name from a hat, and becomes that person’s Secret Santa (they’ll buy an anonymous gift for that person)

    * If a person draws their own name, they draw again.


    #### Example:
    INPUT:
    ```
    [adam, betty, charlie, dante]

    ```

    OUTPUT:
    ```
    [

    [adam, dante]
, [betty, charlie], [charlie, dante], [dante, adam]
    ]

    ```

  3. ndisampson revised this gist Jul 28, 2020. No changes.
  4. ndisampson created this gist Jul 28, 2020.
    3 changes: 3 additions & 0 deletions comic_book_app.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    ### Problem 2: Add a search feature to a comic book reading application.

    Pretend we have an application that allows users to log in and read comic books. Think of it as a mix between netflix and kindle. Users can search for content, add to a reading list, share with friends, etc. The stack is a react client with an Express api server, and your DB of choice. How would you add a search feature to this app?
    20 changes: 20 additions & 0 deletions secret_santa.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    ### Problem 1: Implement a Secret Santa Matching Algorithm



    The algorithm should take a set of names and return a set of pairs of names chosen randomly as follows:


    * Each person’s name is put in “a hat”.

    * Each person randomly draws a name from a hat, and becomes that person’s Secret Santa (they’ll buy an anonymous gift for that person)

    * If a person draws their own name, they draw again.


    #### Example:
    INPUT:
    ```
    [adam, betty, charlie, dante]

    ```

    OUTPUT:
    ```
    [

    [adam, dante]
, [betty, charlie], [charlie, dante], [dante, adam]
    ]

    ```