Back to Challenge Set 20

Code Challenge: Shortlist

Difficulty  

divider

The Brief

What they asked for
We had seven applicants and I have their scores. Give me the
ones worth interviewing, best first.

Write your requirements list before you write any code. Input, calculate, output, and anything you had to decide for yourself.


Notes

  • This brief is deliberately underspecified, and there is no bonus for guessing what I meant. Write down what it does not tell you, decide, and say so.
  • Worth interviewing above what score? How many do you show? What happens if more clear the bar than you are showing?
  • There is a tie in any sensible test data. Decide what a tie does before you hit one.
  • Run it twice with different settings, so you can see your decisions actually take effect.

Sample Output

Sample Output
4 of 7 scored 75 or better
1. Ravi (95)
2. Nadia (88)
3. Sam (88)
...and 1 more above the cutoff
1 of 7 scored 90 or better
1. Ravi (95)

The cutoff and how many to show became two parameters. Nadia and Sam tie on 88; this version keeps them in the order they applied.


Submit

Your requirements list and your program file, named cc-shortlist.

Commence Challenge