Pergunta de entrevista da empresa Compass

In the language of your choice, write a program to query a certain public API and return the last K activities for a given user. Output the results to a CSV file.