What are the Coding Challenges Like?

Our principles


  • Demonstrate applied problem solving
  • Reflect real-life software engineering
  • Concrete milestones and progression
  • No brain-teasers
  • No theoretical algorithm questions

Most candidates who have done software engineering professionally, in class, in boot-camps or as a hobby should feel comfortable with the code challenges we present.

We do not care for abstract algorithm or exotic data structures, and you do not need to go through textbooks to prepare for our code challenges.

We focus on applied problem solving and progression. Our questions are structured with achievable milestones.

Sample Question


Instruction
Build a simple Yelp-like system: Given a set of restaurant and metadata (coordinates, ratings, opening hours), design and implement the following functionalities without using a database.

1. Find restaurants within specified radius, given a coordinate
2. Improve the above function by only returning restaurants that are open given desired dining hour
3. Improve the above function by sorting the results by average ratings
Skeleton Code
#!/usr/bin/env python

class Yelp(object):
    def __init__(self, restaurants, ratings):
        self.restaurants = restaurants
        self.ratings = ratings

    def find(self, coordinates, radius, dining_hour=None, sort_by_rating=False):
        # Returns list of Restaurant within radius.
        #
        #  coordinates: (latitude, longitude)
        #  radius: kilometer in integer
        #  dining_hour: If None, find any restaurant in radius.
        #               Otherwise return list of open restaurants at specified hour.
        #  sort_by_rating: If True, sort result in descending order,
        #                  highest rated first.
        raise NotImplementedError("please implement")

class Restaurant(object):
    # where open_hour and close_hour is in [0-23]
    def __init__(self, id, name, latitude, longitude, open_hour, close_hour):
        self.id = id
        ...

class Rating(object):
    # rating is in [1-5]
    def __init__(self, restaurant_id, rating):
        self.restaurant_id = restaurant_id
        self.rating = rating

def main(argv):
    restaurants = [Restaurant(0, "Domino's Pizza", 37.7577, -122.4376, 7, 23), ...]
    ratings = [Rating(0, 3), ...]

    y = Yelp(restaurants, ratings)
    y.find((37.7, -122.6), 5, None, False)
#!/usr/bin/env ruby

class Yelp
  def initialize(restaurants, ratings)
    @restaurants = restaurants
    @ratings = ratings
  end

  # Returns list of Restaurant within radius.
  #
  #  latitude: latitude in Float
  #  longitude: longitude in Float
  #  radius: kilometer in Fixnum
  #  dining_hour: If nil, find any restaurant in radius.
  #               Otherwise return list of open restaurants at specified hour.
  #  sort_by_rating: If true, sort result in descending order,
  #                  highest rated first.
  #
  def find(latitude, longitude, radius, dining_hour=nil, sort_by_rating=false)
    raise "please implement"
  end
end

class Restaurant
  # where open_hour and close_hour is in [0-23]
  def initialize(id, name, latitude, longitude, open_hour, close_hour)
    @id = id
    ...
  end
end

class Rating
  # rating is in [1-5]
  def initialize(restaurant_id, rating)
    @restaurant_id = restaurant_id
    @rating = rating
  end
end

if __FILE__ == $0
  restaurants = [Restaurant.new(0, "Domino's Pizza", 37.7577, -122.4376, 7, 23), ...]
  ratings = [Rating.new(0, 3), ...]

  y = Yelp.new(restaurants, ratings)
  y.find(37.7, -122.6, 5, nil, false)
end
public class Yelp {
  private List<Restaurant> restaurants;
  private List<Rating> ratings;

  public Yelp(List<Restaurant> restaurants, List<Rating> ratings) {
    this.restaurants = restaurants;
    this.ratings = ratings;
  }

  /*
   * Returns list of Restaurant within radius.
   *
   *  latitude: double
   *  longitude: double
   *  radius: kilometer in int
   *  diningHour: If null, find any restaurant in radius.
   *              Otherwise return list of open restaurants at specified hour.
   *  sortByRating: If true, sort result in descending order,
   *                highest rated first.
   */
  public List<Restaurant> find(double latitude, double longitude, int radius,
      int diningHour, boolean sortByRating) {
    throw new UnsupportedOperationException("please implement");
  }

  public static class Restaurant {
    private double latitude;
    private double longitude;
    private int id;
    private String name;
    private int openHour;   /* in [0-23] */
    private int closeHour;  /* in [0-23] */

    public Restaurant(...) { ... }  /* Omitted */
  }

  public static class Rating {
    private int id;
    private int rating;      /* in [1-5] */

    public Rating(...) { ... }      /* Omitted */
  }

  public static void main(String[] args) {
    List<Restaurant> restaurants = ...;  /* Omitted */
    List<Rating> ratings = ...;          /* Omitted */

    Yelp y = new Yelp(restaurants, ratings);
    y.find(-37.7, -122.6, 5, null, false);
  }
}
using namespace std;

struct Restaurant {
  double latitude;
  double longitude;
  int id;
  string name;
  int open_hour;   /* in [0-23] */
  int close_hour;  /* in [0-23] */

  Restaurant(...) { ... }  /* Omitted */
};

struct Rating {
  int id;
  int rating;      /* in [1-5] */

  Rating(...) { ... }      /* Omitted */
};

class Yelp {
 public:
  Yelp(vector<Restaurant> restaurants, vector<Rating> ratings) : restaurants_(restaurants), ratings_(ratings) { }
  ~Yelp() { }

  /*
   * Returns list of Restaurant within radius.
   *
   *  latitude: double
   *  longitude: double
   *  radius: kilometer in int
   *  dining_hour: If null, find any restaurant in radius.
   *               Otherwise return list of open restaurants at specified hour.
   *  sort_by_rating: If true, sort result in descending order,
   *                  highest rated first.
   */
  vector<Restaurant> find(double latitude, double longitude, int radius,
      int dining_hour, boolean sort_by_rating) {
    cout << "please implement" << endl;
    vector<Restaurant> output;
    return output;
  }

 private:
  vector<Restaurant> restaurants_;
  vector<Rating> ratings_;
};

int main(int argc, char* argv[]) {
  vector<Restaurant> restaurants = ...;  /* Omitted */
  vector<Rating> ratings = ...;          /* Omitted */

  Yelp y = Yelp(restaurants, ratings);
  y.find(-37.7, -122.6, 5, null, false);
}
class Yelp {
  var restaurants: [Restaurant]
  var ratings: [Rating]

  init(_ restautants: [Restaurant], _ ratings: [Rating]) {
    self.restaurants = restaurants
    self.ratings = ratings
  }

  /*
  Returns list of Restaurant within radius.

    latitude: Double
    longitude: Double
    radius: kilometer in Int
    diningHour: If nil, find any restaurant in radius.
                Otherwise return list of open restaurants at specified hour.
    sortByRating: If true, sort result in descending order,
                  highest rated first.
  */
  func find(latitude: Double, longitude: Double, radius: Int,
    diningHour: Int?, sortByRating: Bool) -> [Restaurant] {
    // IMPLEMENT ME
  }
}

class Restaurant {
  var latitude: Double
  var longitude: Double
  var id: Int
  var name: String
  var openHour: Int // in [0-23]
  var closeHour : Int // in [0-23]
  init(...) { ... } // Omitted
}

class Rating {
  var id: Int
  var rating: Int // in [1-5]
  init(...) { ... } // Omitted
}

func main() {
  var restaurants: [Restaurant] = ... // Omitted
  var ratings: [Rating] = ... // Omitted

  var y = Yelp(restaurants, ratings)
  y.find(-37.7, -122.6, 5, nil, false)
}
function Yelp(restaurants, ratings) {
  this.restaurants = restaurants;
  this.ratings = ratings;
}

/*
Returns list of Restaurant within radius.

  latitude: latitude in number
  longitude: longitude in number
  radius: kilometer in number
  diningHour: If null, find any restaurant in radius.
              Otherwise return array of open restaurants at specified hour.
  sortByRating: If true, sort result in descending order,
                highest rated first.
*/
Yelp.prototype.find = function(latitude, longitude, radius, diningHour, sortByRating) {
  // IMPLEMENT ME
}

function Restaurant(id, name, latitude, longitude, openHour, closeHour) {
  this.latitude = latitude;
  this.longitude = longitude;
  this.id = id;
  this.name = name;
  this.openHour = openHour; // in [0-23]
  this.closeHour = closeHour; // in [0-23]
}

function Rating(id, rating) {
  this.id = id;
  this.rating = rating; // in [1-5]
}

function main() {
  restaurants = [new Restaurant(0, "Domino's Pizza", 37.7577, -122.4376, 7, 23), ...]; // Omitted
  ratings = [new Rating(0, 3), ...]; //Omitted

  y = new Yelp(restaurants, ratings);
  y.find(37.7, -122.6, 5, null, false);
}

If you still feel a bit rusty, no worries. Here are some pointers to help you brush up:

Feel free to reach out to us if you have questions or concerns.