Airbnb interview question

General Coding round: I had to write the code either in python or java. I was given a dictionary of listings. Each listing had multiple list type key/value pairs inside like amenities, ratings, reviews, guest ids, host ids. Based on this listings variable, there were multiple questions like: Q1. Give all cohosts with the count of their listings. Q2. Give the guest id with the lowest average rating. How do you handle ties? Q3. Sort listings from top to bottom as per average rating. In case of tie, use the one with the latest review date.