← Fanatics Interview Insights

Fanatics·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

Fanatics SWE interview had me building an ASCII chart renderer from scratch. The problem sounds almost toy-like until you're actually staring at the grid logic and trying to get the border segments right under pressure.

Questions Asked (1)

Q1

Given an unsorted array of (timestamp, price) integer pairs, write a function that renders an ASCII time series chart. The x-axis should cover every integer timestamp from min to max, the y-axis every integer price from max down to min. Mark observed data points with '*', frame the chart with '+' borders where the top and bottom use repeating '+-----' segments, and return the result as a list of strings. Walk through your approach and complexity.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

I started by figuring out the ranges first, min/max for both axes, then built a 2D grid initialized to spaces.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, clarify the problem constraints and edge cases (e.g., empty input, duplicate timestamps, single point). Then, outline a step-by-step algorithm: compute min/max timestamps and prices, initialize a grid of spaces, mark data points, add borders, and convert to strings. Finally, analyze time and space complexity, and discuss potential optimizations or trade-offs.

Pro tip: Before coding, confirm the exact border format and whether multiple data points at the same timestamp should be handled (e.g., last one wins or all marked). This shows attention to detail and avoids rework.

1. Clarify requirements and edge cases

Ask about input size, duplicate timestamps, empty array, and exact border formatting. Confirm that the chart should include all integer timestamps and prices between min and max.

2. Determine dimensions and initialize grid

Compute min/max timestamp and price to get width and height. Create a 2D grid (list of lists) filled with spaces, with extra rows/columns for borders.

3. Plot data points

Iterate through the input array and mark each (timestamp, price) as '*' in the grid. Handle duplicates by deciding whether to overwrite or keep the first/last occurrence.

4. Add borders and convert to strings

Add '+' at corners and along edges, with repeating '+-----' segments on top and bottom. Convert each row to a string and return the list.

5. Analyze complexity and discuss trade-offs

State time complexity O(n + W*H) and space O(W*H), where W and H are the ranges. Mention potential optimizations like using a dictionary for sparse data or handling large ranges.

Key Points to Mention

  • Time complexity: O(n + W*H) where n is number of points, W and H are timestamp and price ranges.
  • Space complexity: O(W*H) for the grid, which may be large if ranges are wide.
  • Handling edge cases: empty input, single point, duplicate timestamps, negative values.
  • Border construction: top and bottom rows use repeating '+-----' segments, sides use '|'.
  • Data structure choice: 2D array vs. dictionary for sparse data.
  • Potential optimizations: coordinate compression if ranges are huge but points are sparse.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.