Flow Traders interview question

How to use map. flatmap and pivot in pyspark