Two Sigma Interview Question

Several questions involving strings and graphs.