Coder Social home page Coder Social logo

library-sample's Introduction

library-sample

Take-home Test

Introduction

This small project is helpful for us in evaluating your programming experience. The only requirement is development experience in a modern language such as Java, .Net, NodeJS, Python). When designing the application, be sure to practice good architecture and coding practices. Feel free to create whatever classes and data types you feel necessary to accomplish the task.

You may use the Internet as a reference tool. The only restriction is that you must not contact any other individuals for help. This includes through instant or text messaging, e-mail, phone calls or posts to discussion forums. You may read through previous discussion forum posts, however.

The Project

Create an application that maintains a database of books. The user, through a command line interface (CLI), should be able to view, add and edit book entries. In addition, a search function should allow the user to find books by keyword.

Data types

The following is the only required data type. Feel free to create any other types or classes you feel necessary.

  • Book
    • id – int
    • title – String
    • author – String
    • description – String

User functions

  • View all books in the database
    • List the ID and title of each book
    • Allow the user to see details of a particular book
  • Add a new book
    • Prompt the user for the book title, author and description
    • Save their changes to the database
  • Edit an existing book
    • Display a list of available books
    • Allow the user to select a book to edit
    • Display each field, one at a time, and allow them to change the value of the field. The user should be able to leave the value unchanged.
  • Search for books using keywords
    • The search function is up to you to define. Keep the scope small enough that you can accomplish it within the time frame. If you have extra time, you can spend it adding additional features to the search.

System functions

  • Write the database of books to disk, upon exiting the application
  • Load the database of books from disk, at application start time

The format of the disk file can be any of your choosing.

Sample Session

The following is a sample of what a session of the application may look like. Note that this is not the first time the application is run, as indicated by the number of books already in the library.

Loaded 5 books into the library

==== Book Manager ====

    1) View all books
    2) Add a book
    3) Edit a book
    4) Search for a book
    5) Save and exit

Choose [1-5]: 4

==== Search ====

Type in one or more keywords to search for

    Search: **moby**

The following books matched your query. Enter the book ID to see more details, or <Enter> to return.

    [4] Moby Dick

Book ID: 4

    ID: 4
    Title: Moby Dick
    Author: Herman Melville
    Description: About a big whale

Book ID: <Enter>

==== Book Manager ====

    1) View all books
    2) Add a book
    3) Edit a book
    4) Search for a book
    5) Save and exit

Choose [1-5]: 3

==== Edit a Book ====

    [1] The Hobbit
    [2] Lord of the Rings
    [3] Snow White and the Seven Dwarfs
    [4] Moby Dick
    [5] Snow Crash

Enter the book ID of the book you want to edit; to return press <Enter>.

Book ID: 4

Input the following information. To leave a field unchanged, hit <Enter>

    Title [Moby Dick]: _\<Enter\>_
    Author: [Herman Melville]: _\<Enter\>_
    Description: [About a big whale]: **About a really big whale that**

Book saved.

Enter the book ID of the book you want to edit; to return press <Enter>.

Book ID: <Enter>

==== Book Manager ====

    1) View all books
    2) Add a book
    3) Edit a book
    4) Search for a book
    5) Save and exit

Choose [1-5]: 2

==== Add a Book ====

Please enter the following information:

    Title: **Kite Runner**
    Author: **Khaled Hosseini**
    Description: **Story of Amir, a young boy from Kabul.**

Book [6] Saved

==== Book Manager ====

    1) View all books
    2) Add a book
    3) Edit a book
    4) Search for a book
    5) Save and exit

Choose [1-5]: 1

==== View Books ====

    [1] The Hobbit
    [2] Lord of the Rings
    [3] Snow White and the Seven Dwarfs
    [4] Moby Dick
    [5] Snow Crash
    [6] Kite Runner

To view details enter the book ID, to return press <Enter>.

Book ID: 6

    ID: 6
    Title: Kite Runner
    Author: Khaled Hosseini
    Description: Story of Amir, a young boy from Kabul.

To view details enter the book ID, to return press <Enter>.

Book ID: 4

    ID: 4
    Title: Moby Dick
    Author: Herman Melville
    Description: About a really big whale that

To view details enter the book ID, to return press <Enter>.

Book ID: <Enter>

==== Book Manager ====

    1) View all books
    2) Add a book
    3) Edit a book
    4) Search for a book
    5) Save and exit

Choose [1-5]: 5

Library saved.

library-sample's People

Watchers

Lee Peterson 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.