#Day 1#

Estimated Completion Time: 10-20 minutes.

Welcome to Duck Inc.

You have accepted this position at the amazing Duck Inc. We have this amazing new cloning technology that will transform your code into real ducks. Surprisingly it runs on PHP!

Luckily ducks are surprisingly easy to create because the cloning machine is so advanced.

So for your first project we need you to build a Mallard.

All you need to do is:

  1. Create a Mallard class (we handled the creation of the file for you.)
  2. The Mallard class will need to be able to fly, quack, swim. When you add these methods the cloning machine will give the duck these abilities.
  3. Each method should just return its name in the form of a string. (Example: quack()->"quack" ).
  4. The sales team has already let us know that more species of duck are going to be needed in the future. So keep that in mind.
  5. The Duck Inc QA team handled the phpunit test for you. These will validate the ducks you are creating. If you want to test your work feel free to run phpunit root directory

We included a little markup to get you started today. We need you to complete work by Tuesday. Your pull request should be submitted in the format of "Your Name - Day 1"

If you have any questions feel free to reach out to Mitch or Kelvin.

Good Luck on your first day

#Day 2#

Remember to get your pull request in for Day 1!

So great news sales has finally closed the deal with the Duck Feather Pillow Company and they have put in a huge order for Canvasback ducks.

So your task for today is implement a Canvasback class.

Of course the canvasback will need to be able to quack, fly and swim. It turns out though that the canvasback is a slow swimmer so make sure the output for the swimming method is 'swim slowly'.

Oh the team working on the cloning machine have asked that the ducks have a clone method with some of their technical code be added to the ducks as well. I put the code below:

public function replicate()
{
  return get_class($this);
}

This will need to be added to all ducks in order for them to clone.

Please submit your Pull Request by Wednesday and the title should be "{{Your Name}} - Day 2"

#Day 3#

Remember to get your pull request in for Day 2!

So sort of good news. Tommy the new sales guy was able to close a giant deal with a Bath, Bath, and Beyond.

Unfortunately, Tommy didn't really understand the product very well and the ducks that he sold were Rubber ducks..

We haven't told the cloning team yet but in the mean time we need you to create a RubberDuck class.

The RubberDuck class can quack and swim, however, it cannot fly. So that method should not be implemented.

Also as a bonus RubberDuck should have a method called listen. Which can be helpful for programmers working on hard tasks.

Last thing the cloning team asked that your replicate function return an instance of the class itself. They provided some code:

public function replicate()
{
  return $this;
}

Thanks for all of your hard work this week. Get your pull request in by tomorrow please.

#Day 4#

Remember to get your pull request in for Day 3!

Some good news/bad news today.

The bad news first.

No one in management told the Mark from the Cloning Machine team about the rubber ducks. Apparently the cloning machine wasn't setup properly to clone non-living ducks.

The ducks that were cloned were living-rubber hybrids that quacked "kill me". The weight of all those ducks souls was to much for Mark and he resigned.

The good news!

You have been promoted to principle cloning engineer and you will be responsible for all things cloning related, including the ducks! (There is no salary increase only a title change.)

We added Marks code for you.

We need you to redesign the cloning machine so that you do not have to incur any future modification costs when the company grows and begins to clone other animals besides ducks.

So task for you to do is to take the CloningMachine class and refactor it in a way that will support all of the ducks and other animals in the future.