Skip to content

danielwwc/nodejs-coding-challenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

NodeJS-Coding-Challenge

Thank you for taking the time to face this coding challenge. Don’t spend more than one hour on this challenge. Use Javascript or Typescript code to solve these challenges. Good luck!

  1. Write a function to transform array a to array b and print the elements of array b to the console.
let a = [2, 4, 6, 8, 9, 15]
let b = ['4', '16', '64']
  1. Write a function to calculate the cumulative TTL of the following set of requests. (The provided answer is correct and should not be modified. )
let requests = [
{requestId: 'poiax',  startedAt: 1489744808, ttl: 8},
{requestId: 'kdfhd',  startedAt: 1489744803, ttl: 3},
{requestId: 'uqwyet', startedAt: 1489744806, ttl: 12}, 
{requestId: 'qewaz',  startedAt: 1489744810, ttl: 1}
]

let cumulativeTtl = 15
  1. Read a text file containing a set of flat polygons represented as one polygon per line. Each line contains a comma-separated list of side lengths (for example "3,4,8,5,7"). Write a function to classify the set of polygons into four mutually exclusive subsets: triangles, rectangles, squares, and everything else. The union of all four subsets should be the original set of polygons. All the sides of the polygons are connected and the angles between them are irrelevant. Only consider the lengths.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published