/geektrust-challenge-meet-the-family

Primary LanguageJavaGNU General Public License v3.0GPL-3.0

gradle-coverage codecov CodeFactor DeepSource
License Java
commits last-commit releases

Problem Statement

We need to create a pre-populated family tree, that supports -

  1. Adding new Members to tree through Mothers
  2. Determining all the people who hold a given relation with a member in the Family Tree.

Assumptions

From Problem Statement

  1. Names are Unique.
  2. New Members are added through Mothers.

Additional Assumptions Made

  1. Only two Genders (Male & Female) are supported.
  2. A couple has a male & a female member.
  3. Names are case-sensitive.
  4. Family Tree is build left-to right in DFS order.

Running the project

  1. Download the latest geektrust.jar
  2. Execute the following command replacing with the path for input file
java -jar geektrust.jar <path-to-inputfile>

OR

  1. Download the source code.
  2. Build the project using -
./gradlew clean build
  1. Use the generated jar from build/lib folder and execute -
java -jar geektrust.jar <path-to-inputfile>