Skip to content
This repository was archived by the owner on Apr 15, 2018. It is now read-only.

cmcgroarty/athenium-code-exercise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 

Repository files navigation

athenium-code-exercise

Question 1: SQL

Assume you have the following tables:

Item

Field Type Null Key Extra
itemID int(11) PRI auto_increment
name varchar(64)
description varchar(128) YES
categoryID int(11) YES

Category

Field Type Null Key Extra
categoryID int(11) PRI auto_increment
name varchar(64)

ItemOrderMembership

Field Type Null Key Extra
orderID int(11)
itemID int(11)

Write a query that will get me the item name and item category name for all items in orderID 12345. Please note that Item.categoryID may be NULL, and that the query should return item names even for those records where this is the case.

Question 2: Programming

A teacher gives a class of students an exam. He decides to grade the exam using the following method:

  • A score in the top 20% of all scores is an A.
  • A score in the next 20% of scores is a B.
  • A score in the next 20% of scores is a C.
  • A score in the next 20% of scores is a D.
  • A score in the bottom 20% of scores is an F.

For example, if a class of 20 students has the following scores: 99, 92, 91, 91, 89, 85, 83, 82, 80, 79, 78, 78, 77, 76, 75, 74, 62, 55, 43, 20 The first four scores (99, 92, 91, 91) would be an A, scores 5 through 8 (89, 85, 83, 82) would be a B, scores 9 through 12 (80, 79, 78, 78) would be a C, scores 13 through 16 would be a D (77, 76, 75, 74) and scores 17 through 20 (62, 55, 43, 20) would be an F.

Write a function that takes an arbitrary (possibly unsorted) score list of any length (not necessarily the list used as an example above) as a parameter, and returns a grade for each score.

Note that since the list of scores can be of any length the number of scores may not necessarily be divisible by 5. Please make sure your function will handle those cases gracefully and consistently. ADDITIONAL REQUIREMENT: If there are two (or more) scores that are identical, then those identical numerical scores must always receive the same grade, even if that causes some grades to contain more scores than others. You may use any programming language you wish. Please make sure your code is syntactically valid and would produce an output that identifies which letter grade is received by each numerical score in the input list.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published