Coder Social home page Coder Social logo

ashleyconnor / se-challenge-payroll-rails Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 39 KB

Coding assignment for Software Engineering position @ Wave Accountancy in Toronto, Canada.

Ruby 78.82% JavaScript 2.75% CSS 1.65% HTML 16.78%
wave wave-accounting interview-assignment coding-interview

se-challenge-payroll-rails's Introduction

README

Interview

I interviewed for a Software Engineering positon with Wave back in 2018.

This is the coding assigment given to me, the result allowed me to proceed to an on-site although an offer wasn't extended for that position I was invited to apply an Operations Engineering role which I declined.

Overall the interview wasn't difficult but I think nerves got the better of me on the day as it was my first on-site in three years.

The practice proved useful and I received an offer from Capital One the next week.

I wrote up a short review on GlassDoor:

https://www.glassdoor.ca/Interview/Wave-Senior-Software-Engineer-Interview-Questions-EI_IE554319.0,4_KO5,29.htm#InterviewReview_24620498

Challenge

A copy of the challenge can be found here.

Result

Instructions

  • Ruby version
  • Built using ruby 2.3.4p301
  • Requires ruby 2.2.2+
  • System dependencies
  • Possibly sqlitedev dependencies - install via:
  • brew install sqlite for OSX
  • apt-get install sqlite3 libsqlite3-dev debian systems
  • yum install sqlite3 libsqlite3-dev el systems
  • Configuration
  • bundle install in app directory
  • Database creation
  • rails db:create
  • Database initialization
  • rails db:migrate && rails db:seed

Introduction

I've heavily leveraged ruby/rails standard libraries because I believe they make code more readable.

I also had a to make a tradeoff decision with regards to performance for large CSV files:

Choices were:

  1. Load the entire CSV into memory to reduce the number of DB writes
  2. Load the CSV line-by-line and write into the DB, also updating the Payroll Entry totals

I chose 2 primarily from experience with Ruby memory consumption but 1 would allow us to rollback a DB transaction if data was invalid.

Assumptions I made

  1. JobGroup records are immutable OR old CSVs are not uploaded e.g. if a job group has updated the hourly wage and a CSV is uploaded that was intended to reference the previous hourly wage. In that case we should either - create a new JobGroup or denormalise the data.
  2. Validation of data is not required - if validation was required then we could make some reasonable assertions on the CSV entries such as hours worked is per day <= 24, JobGroup exists, Employee exists etc.
  3. CSV files might have thousands of entries

se-challenge-payroll-rails's People

Contributors

ashleyconnor avatar

Stargazers

 avatar

Watchers

 avatar  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.