---
# System prepended metadata

title: AML Group Take Home Interview - Algorithms

---

---
title: 'AML Group Take Home Interview - Algorithms'
disqus: algorithms
---

AML Group SWE
===

## Table of Contents

[TOC]

## Background

This is a take-home assignment for AML Group SWE candidates. The focus of this assignment is algorithm creation and evaluation. Regardless of if you correctly complete the question, be sure to show your thought process as in many instances there are degrees of accuracy. If you need clarification on a problem, feel free to reach out.

Topics covered
---
- Machine Learning Algorithms
- Graph Algorithms
- Sort Algorithms

Question 1
---
The Perceptron algorithm was the first machine learning algorithm developed to iteratively separate seperable points using a plane. Read more [here](https://en.wikipedia.org/wiki/Perceptron)

Develop a fully functional, 2-Dimensional Pereptron using Python. The script should take in a .csv file of points and outputs a line that separates them or an error if the points are not linearly separable.

Question 2
---
Sort algorithms are generally useful as they are fairly simple but the complexity and speed of different approaches can change rapidly. 

We have a situation in which there are *n* items to be sorted and *k* unique items (think sorting highest scoring total for NBA players this season). Design and implement in python a *k log n* algorithm for sorting this list where *k* is much smaller than *n*.

Question 3
---
Graph algorithms help visualize the complexities of systems and many real systems can be represented this way. For this question, it may be helpful to understand [Djikstra's Algoirthm](https://en.wikipedia.org/wiki/Dijkstra's_algorithm) 

You are given a directed graph and edge lengths (think flight routes between different cities) and we need an algorithm to find the shortest path from one node to the next that uses an odd number of edges. The algorithm must run in the same or less time as Djikstra's. Give a justification of runtime and implement it in Python such that it can recieve a CSV of edges and input for two nodes to find the path between, and output the path.

Question 4
---
Assume you have a 1-Dimensional road for electric vehicles to travel on, and along this road there are many houses spaced along it. These cars are meant for joy rides and have a maximum range of 5 miles. All the owners want is to make sure there is always a station within 5 miles of their house so they can take it to and from the station to enjoy it. Design and implement in Python an algorithm that takes in a list of points (houses) along the line, and outputs a minimum number of stations and their locations along the line.

## Specifications & Deliverables
Please submit code and any supplementary information via this [link](https://airtable.com/shr2ZqXEKYD8LUDtu).

We recommend submitting within 5 days.

## Questions
If you have questions please reach out to Nicole through nicole@amlgroup.us.