Giter VIP home page Giter VIP logo

job-interview-solid-principles-test's Introduction

Job interview: SOLID principles test

A programming job interview questions that test the understanding of basic principles and patterns

The test should be solved in two rounds, the text of the second round given to the job applicant only after they solve the first round. The purpose of these rounds is to check if the applicant can plan ahead and write extensible code before additional features are known.


Use the programming language of your choice to write a console application that simulates a ferry terminal. The code must be modular and easily extensible. After you complete the first 5 tasks you will receive 3 very short additional tasks to test if the code is really easily extensible.

Round 1:

  1. Two kinds of ferries are available at any time:

    • small ferry has space for 8 small vehicles (cars pay 3€ / vans pay 4€).
    • large ferry has space for 6 large vehicles (buses pay 5€ / trucks pay 6€).

    The application must display all income made from tickets.

  2. Vehicles are constantly arriving to the terminal in random order. A terminal employee is paid to park them on the ferry - his salary is 10% of every ferry ticket. The application must display his income.

  3. Every vehicle arrives with a random amount of gas. If any vehicle has less than 10% of gas left, the terminal employee must fill it up at the gas station. The application must display the amount of gas for the current vehicle.

  4. Every van and every truck must go through customs inspection. The terminal employee must open the cargo doors for inspection. The application must display whether the cargo doors of the current vehicle are open or closed.

  5. Track the car from the arrival to the ferry. The application must display the name of the last location visited (crossroads don't count).

         A
         |
     G - 1 - S
     |   |
     C - 2 - L
    
     A - Arrival
     G - Gas station
     1 - crossroad 1
     S - Small ferry
     C - Customs inspection
     2 - crossroad 2
     L - Large ferry
    

Round 2:

  1. Add another terminal employee that does the exact same job. His salary is 11% of every ferry ticket. The application must display his income.

  2. Add a battery recharge station. Every electric car arrives with a random battery charge. If the battery is below 10% then the terminal employee must recharge it. The application must display the battery charge for the current vehicle.

  3. Add a new eco ferry that carries 10 eco cars (electric cars pay 1€ / hybrid cars pay 2€). Hybrid cars don't have to be refilled with gas if they have more than 50% battery charge. Hybrid cars don't have to have the battery recharged if they have more than 50% of gas left.

         A
         |
     G - 1 - S
     |   |
     C - 2 - L
     |   |
     B - 3 - E
    
     A - Arrival
     G - Gas station
     1 - crossroad 1
     S - Small ferry
     C - Customs inspection
     2 - crossroad 2
     L - Large ferry
     B - Battery recharge station
     3 - crossroad 3
     E - Eco ferry
    

In the first round you were asked to write modular and easily extensible code. It there anything you could have done differently in the first round that would make the last three tasks of the second round easier? If yes, what exactly?

job-interview-solid-principles-test's People

Contributors

jinjinov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.