Fanatics Code assessment
Summary
I completed a code assessment for Fanatics where I was tasked with creating an ASCII chart display program based on a given set of data points.
Full Experience
I was given a code assessment for Fanatics. The task involved writing a program that could display an ASCII chart from a given dataset of (x, y) coordinates. The chart needed to show the surrounding components and mark each data point with an asterisk. I also had to consider the max_x and max_y values, either provided or calculated, to properly scale the chart. The example provided illustrated an online auction graph with time on the x-axis and price on the y-axis.
Interview Questions (1)
Write a program in the requested language that will display an ASCII chart given the following data:
data = {(1,2), (2, 3), (3, 1), (4, 6), (5, 8)}
You should be able to print the surrounding components of the chart and then place an * where each data point is specified in the data set. You do not need to print the X and Y legends, but that would be helpful. You are given the max x and max y but if you can calculate that it would be helpful.
Example Output Structure:
+-----+-----+-----+-----+-----+-----
+ * +
+ +
+ * +
$ + +
+ +
+ * +
+ * +
+ * +
+-----+-----+-----+-----+-----+-----+
time
Given Parameters:
max_x = 5max_y = 8data = {{1,2}, {2, 3}, {3, 1}, {4, 6}, {5, 8}}