Skip to content

divyaravichandran/software-engineering-test

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 

Repository files navigation

Supahands Coding Assessment

  • This is a coding asssessment for prospective supahands engineers
  • Please create a new file for the solution, DO NOT modify the seed.py file
  • The seed file MUST NOT be modified, it is expected to generate a list of random timestamps to be used in the test

Submission Instructions

  • Clone this repo
  • Make a FORK, and then create a PR for the FORK from the FORK when you are ready for answer submission!
  • Place your solutions files in the same directory as the seed.py file
  • You can solve the problem using either python, javascript, or ruby
  • Notify careers@supahands.com upon PR request with link to PR
  • Solutions that did not follow the submission instructions WILL NOT be considered
  • For guidance on the PR workflow, please read the Hints section

Hints

  • HOW TO PR workflow, please read this guide to PR properly
  • We WILL NOT be processing submissions that do not match the output format as stipulated in Outputs

Problem Statement

  • Given a list of time stamps that is generated by the provided seed.py, where the timestamps represent login time
  • Length is defined as the number of days of consecutive logins, NOT the number of consecutive logins
  • Output a table with time stamps sorted by consecutive logins, sorted by descending length
  • For example, if given the following timestamps
    • ['2021-03-13 15:13:05', '2021-03-13 23:13:05', '2021-03-16 15:13:05', '2021-03-16 23:13:05', '2021-03-17 07:13:05', '2021-03-17 15:13:05', '2021-03-17 23:13:05', '2021-03-18 07:13:05', '2021-03-18 15:13:05']
  • Since the longest period of consecutive logins occur from 2021-03-16 to 2021-03-18, the answer would be
START END LENGTH
2021-03-16 2021-03-18 3
2021-03-13 2021-03-13 1
  • The problem stems from needing to award badges for consecutive logins in order to reward good behavior as demonstrated by a Supahands labeler

Expected Solution

  • Call the seed.py from the your script in order to generate a data pipeline for the processing code
  • Create a separate unit test for your script file to test the various scenarios presented in your script
  • DO NOT edit or amend the seed.py file
  • Include a separate readme in the form of a README.txt if additional instructions are required to get your solution running
  • Your solution should follow best practices such as DRY, KISS, YAGNI, SOLID etc.
  • IMPORTANT Your solution should consists of a solution file, a unit test file and a README.txt if necessary
  • Your solution will be rated for cyclomatic complexity, code maintainability, adherence to best practices, elegance of solution, defensibility and performance
  • Solutions that do not follow the submission instructions WILL NOT be considered

Outputs

Our test script expects a stdout of the following format

START END LENGTH
2021-03-03 2021-03-10 8
2021-02-15 2021-03-18 4
2021-02-10 2021-03-12 3
2021-01-03 2021-01-03 1

About

Alternate test for non CS majors

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%