Skip to content

JosephMutugi/InfraInternshipChallengeMay2018

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Infra Internship Code Challenge - 22nd May 2018

Due: 23rd 9:00am May or Earlier

There are three interdependent tasks in this challenge, complete ALL. The submission instructions are specified at the bottom of the challenge page.

Task 1

This program will be referred to as "logger"

Write a program that prints exactly 1000 lines of text to standard output. Each line of text is a date in the form dd/MM/YYYY, where:

  • valid ranges for days are 00-30
  • valid ranges for months are 1-12
  • valid ranges for years are 2017-2018 The lines of text are to be generated randomly - that is, there should be a reasonably arbitrary distribution of logs from all possible dates.

Task 2

This program will be referred to as "viewer"

Write a program that reads lines of test from standard input. The program should process each line and:

  • Print "Malformed input" and exit, if the line is not in the form dd/MM/YYYY
  • Count lines from each month that appears in a line. The program should not count months that do not appear in any line.
  • Print lines from 0-14th of 2018. Finally, the program should print each logged month with the percentage of lines of text from that month in the form:
    Month: XX%
    Where "Month" refers to the name of that month.
    For example:
    May: 35%

Task 3

Launch the logger program and pipe its output to the viewer program.



How to submit

  1. Check out the format for submitting your code here

  2. Make sure when creating a branch to use your correct phone Number, as this is what we will use to get back to you.

NB: As a branch-name you can also use your email. See you on the other side, and best of luck!

Join Slack

In case you have any questions, join our Slack here and join the #internship-challenge channel.

About Africa's Talking Code Challenges

Please read the overview here.

About

Infra internship challenge for May 2018

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published