Code Monkey home page Code Monkey logo

coding-challenge's Introduction

Response to Coding Challenge

Release Notes

  • Made the Contact page the default page that loads
  • Added API Controller /api/contacts accepting 2 parameters
    • lastName
    • sortAscending [true/false]
  • Updated navigation to have a convenient link to the api method, including query string parameters for ease of use
  • Used Sqlite as data store, needed a ninja move to make the Sqlite in-memory database stay persistent between requests, but not between restarts.
  • Updated .gitignore, was outdated and adding obj and bin files

TODO:

  • Make logging more useful
  • Add instrumentation
  • Add security / do security review
  • Upgrade to .Net 6
  • Containerize

The Problem: Design a web based mailing list application. The following requirements are relatively simple, but the application should be designed so that it could be used as the basis for a more complete implementation. In other words, use sound design patterns and coding practices. Requirements:

  1. ✅ Provide a simple html page in which a user can enter the following. The page merely needs to be functional and does not need to be styled in any way.
    • Last Name
    • First Name
    • Email
  2. ✅ When the user submits this data, the input should be validated against the following rules. Any validation errors should be presented to the user.
    • First Name cannot be empty
    • Last Name cannot be empty
    • Email must be a valid email address.
    • If all validation succeeds, a confirmation page should be displayed which tells the user the data was received by the system.
  3. ✅ All data submitted in this way must be saved, but only for the duration of the application’s run. It does not need to survive a restart of the application. However, in your design consider that this application will ultimately have to save this data to a persistent datastore.
  4. ✅ A REST endpoint must be provided to retrieve all mailing list entries. /api/contacts?lastName=smith&sortAscending=true This endpoint should take 2 optional parameters:
  5. ✅ Last name- if specified, only records with this last name are returned requires exact matching, case insensitive
  6. ✅ Ascending/Descending flag which indicates how to sort records. If not specified, default behavior is to sort ascending. Records should be sorted by last name. Where last names are equal, records should be sorted by first name. 📎 I played the role of Product Engineer and made the executive decision to make this case insensitive as a usability enhancement.
  7. ✅ At least one automated test must be provided which tests one of your .net components. Includes 2 business logic tests and 1 api controller test.
  8. ✅ Security is not required for this exercise. 🚫 🔐 🙈

Optional:

  1. ⭐ Add additional tests 3 vs. the 1 that was required
  2. ⭐ Implement appropriate design patterns or principles such as dependency injection Used dependency injection for business logic and data access. Data access layer using IContactsRepostiory is implemented as InMemoryContactsRepository using an in-memory Sqlite database using Dapper ORM. Another implementation using a persistent database could easily be done.

:shipit:

coding-challenge's People

Contributors

clark-marketplace avatar ericwallin avatar slieffers 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.