Egen Interview Question

write sql query and then python code for a table of events and return a pivot like response for certain values.