Skip to content

Code Test 2

Brian Ploetz edited this page Dec 28, 2016 · 8 revisions

Instructions

In answering the code questions, please submit production ready code (for example, imagine this is going to be a tool used by people in our company and worked on by other members of the engineering team). Tests, documentation, and well written code are expected. We recommend you use whatever language you feel strongest in.

We believe this should take less than 3 hours to complete, but understand you may have other commitments and time constraints. Please let me know (roughly) when we should expect your answers (e.g. “over the weekend”, "end of the week"). Let me know if you need more time.

  1. Tell me about a technical book or article you read recently, why you liked it, and why I should read it.

  2. a) Write a function that takes two arrays of integers and returns true if the second array is a subset of the first, or false otherwise. e.g.

is_subset([5,2,6,7], [7,2]) -> true
is_subset([5,2,6,7], [1,7]) -> false

b) Describe the performance characteristics of your solution using Big O notation.

  1. We have some social network posts in a JSON-encoded file (posts.json, attached). We want to learn about the users who made these posts.

Write a program that reads the data from the file and outputs the following:

  1. The id and user name of the user with the highest number of followers.
  2. The id and user name of the user who posted closest to our office in Boston (GPS coordinates are latitude: 42.356680, longitude: -71.060395)

You can email your answers back to me, use gist, or whatever means you think is best. Once I have them I will review with some other members of the engineering team.

posts.json

https://gist.github.com/dnlbyl/439909211045a48d50ed797633c227d7

Clone this wiki locally