GithubHelp home page GithubHelp logo

payvision-recruitment-challenges-software-engineer-js's Introduction

Software Engineer - JS

Here you have the challenge for the software engineer position. You can find in this branch two different challenges, an algorithm one another one to see how you can refactor a dirty code. If you think that you can solve it using some design patters, feel free and apply them. Let's go! ๐Ÿ˜Ž

1- Counting bits

Given an integer, n, we want to know the following:

  1. How many 1-bits are in its binary representation?
  2. Let's say n's binary representation has k significant bits indexed from 1 to k. What are the respective positions (i.e., in ascending order) of each 1-bit?
  3. The performance is really important in this challenge.

Example

Complete Count function in PositiveBitCounter class. It has one parameter: an integer, n. It must return an integer enumerable with the following 1 + k values:

  • The first index (0) must contain the total number of 1 bits in n's binary representation.
  • The subsequent indices must contain the respective positions of the one-indexed 1-bits in n's binary representation.

Output format

Return an enumerable of integers where the first element is the total number of 1-bits in n's binary representation and the subsequent elements are the respective one-indexed locations of each 1-bit from most to least significant.

Tips

The integer n = 161 converts to binary.

1 0 1 0 0 0 0 1

Reverse the binary representation.

1 0 0 0 0 1 0 1

Count number of positive bits: 3 Search the position: 0, 5, 7 Return { 3, 0, 5, 7 }

2- Refactoring fraud detection

Refactor the FraudRadar class. You can make any changes you see that are needed in code or tests. See the tests for more information.

Code Requirements:

  • All the tests must pass.
  • The code should fulfil OOP and SOLID principles.
  • The code should be maintainable.
  • The code should be extensible.
  • You should apply defensive programming practices.
  • Receive the file path is not nice. Think and change the signature and make it cooler.# payvision-recruitment-challenges-software-engineer-js

payvision-recruitment-challenges-software-engineer-js's People

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.