- Register on GitHub (if not registered yet)
- Create a new private repository with name firstName_secondName (i.e. ivan_ivaniv)
- On your local machine create a Maven project.
- Init git repo in your root project directory: 'git init'
- Add remote origin: 'git remote add origin https://github.com/Kivanval/ivan_kyrylov.git'
- Make changes in your project
- Check that your project is compiled (use maven commands for that)
- Commit and push changed files
- Go to repository Settings -> Manage access -> Invite a collaborator and invite imentor-review user
- Send an email with:
- First name
- Last name
- Email address that was used when registered to the program
- Link to the GitHub repository
- Project should be built with Java 1.8+ or scala 2.12 Hints: use maven.compiler.source and maven.compiler.target properties to set version
- Code should be properly formatted according to the Java code conventions
- Any other libraries and frameworks could be used
- mvn test — should run all tests, if tests are presented in the project Hint: do not forget about maven-surefire-plugin to run the tests
- mvn exec:java — should execute project's Main method, if any exists
- The project execution should be in two commands: 'git clone ...', 'mvn ...'
- Any configurations and resources should be bundled in the git repository or maven 'pom.xml'
- For simplicity we can say there is no duplicated keys in each separate collection.
- Hint: start with simple approach and then think about optimizations.
Create JUnit tests for all implementations.
Junit test should be executed by mvn test command.
- You need simple understanding of Java Generics to complete this task.
- You might notice that join operation is similar to SQL join operations. Yes, that's true, recall SQL it might help you to resolve the task!
- Do not forget to test corner cases in your JUnit tests.
- If you are stuck just make an assumption and implement the task based on it. Later we can discuss this on interview
- For the concept hash-join in RDBMS, which allows you to quickly join collections.
- In terms of time complexity it will be O(n), if you don't count the resources needed to create the hash table.
- The hash table is built next to the smaller table, to consume less resources. Depending on the type of join, the same concepts were created with different implementations.
- At some points it was possible to speed up a possible merge, provided the key implements the Comparable interface. After such modification there would be chances related to creation of an index or a possible merge-join, which has almost the same time complexity O(nlogn).
- Also, by the condition you can notice that we have no duplicates and merge-join condition is equality, which means that nested loop connection will be quite unprofitable solution with time complexity O(n^2).