npm package: @rlwchang/zillow-homework
Description: Homework assigned by Zillow Group
Author: Richard Chang
Latest version: 1.0.1

# zillow-homework
Homework assignment from Zillow

## Homework Assignments
The following are the assignments given by the Zillow Group, along with some basic information such as prompt, completion time, and disclosures.

### Front End Exercises

[Start]: 11-15-18 9:22 PM

[End]: 11-15-18 10:44 PM

**Note:** This was a nice fun refresher of Webpack. Interestingly, the configuration is uncannily similar to what I normally use myself.

1. Create a new, emmpty npm project and write a webpack configuration that fulfills the following requirements:
    * Has a single javascript file as the entrypoint into the application.
    * Handles Javascript/ES6/React code with both ```.js``` and ```.jsx``` extensions. Should output a single ES5 ```.js``` bundle with a unique hash added to the filename.
    * Handles SCSS code with ```.scss``` extensions. Should output a single ```.css``` file with a unique hash added to the filename.
    * Handles IMG file with ```.jpeg```, ```.jpg```, ```.png```, ```.gif``` extensions. Should return a link referencing the file.
    * Handles SVG file with ```.svg``` extension. Return a base-64 data-encoded string if file is < 1MB. Otherwise, return a link to the file.



[Start]: 11-16-18 9:22 AM

[Break]: 11-16-18 12:25 PM

[Start]: 11-16-18 8:59 PM

[End]: 11-16-18 9:18 PM

[Amend Start]: 11-20-18 6:21 PM (Handle some edge cases)

[Amend End]: 11-20-18 6:35 PM

**Note:** The React part was pretty straightforward and took less than an hour. The smooth animation really tested my CSS thoughand forced me to brush up on it, so thank you for that. It was a pretty engaging problem with nice edge cases. I left comments about my general approach to acheive the transition.

2. Create a PhotoGallery component.
    * The PhotoGallery componenet should take in an array of images.
    * Each image will have a url and a caption.
    * The captions should be displayed over the image.
    * The PhotoGallery should allow users to either click or swipe through images.
    * Bonus credit for smoothly animating the swipe and transition between images.
    * Handle any edge cases you can think of.


[[SEE zillow-homework 2 REPO at https://github.com/rlwchang/zillow-homework-2]]

[Start]: 11-20-18 8:30 PM

[Break]: 11-20-18 9:06 PM

[Start]: 11-20-18 9:43 PM

[End]: 11-20-18 10:31 PM

**Note:** I did not overengineer this problem and kept it simple. This problem could have taken anywhere from 2 hours as it did for me, to 2 days depending on how much we wanted to build it for scale and production. I left comments on the different weak points of my current solutionas well as what I would do in a production environment with more complex projects.

3. Create an isomorphic/universal Javascript application using React.
    * The application should fetch data from any third party API on the server.
    * Use renderToString to render the React component using data from the API call.
    * Send the response to the client.
    * The client sshould load a Javascript bundle which will hydrate the application.
    * The application should have a div that alerts when clicked.


### Back End Exercise

[Start]: 11-20-18 10:43 PM

[Break]: 11-20-18 12:02 AM

[Start]: 11-21-18 7:56 PM

[Give Up]: 11-21-18 10:19 PM

**Note:** Unfortunately, I had to throw in the towel for this problem. Please forgive me for this, as this was my first Java program (aside from the "hello-world" project that I did to learn how to use Java). I included my general approach and the pros and cons of them as comments. The issue was a casting error that I could not solve. Online suggests that it is a class path issue, but there is barely any information beyond that. Building it as a Maven project also did not help. I have made a note of it in the corresponding file. I could continue digging around and debugging, but I would not be able to complete this problem in a timely manner. I would be glad to learn more Java before joining, but at my current level, I am unable to solve this kind of problem.

1. We have a person class:

```java
class Person {
    String ssn;
    Date dateOfBirth;
    String firstName;
    String lastName;
    Douuble heightIn;
    Double weightLb;
}
```

And we are building a webpage that can display people sorted by any of the Person fields.

Sample request: ```/people?sortField=dateOfBirth&ascending=false```

Using standard Java libraries instead of writing a custom sort, please implement this method in Java to sort the results:

```java
static List<Person> sort(Iterable<Person> people, String sortField, String ascending) {}
```

There are many ways to do it, so please briefly outline a few of the trade-offs you considered.