Flow Traders Interview Question

How to use map. flatmap and pivot in pyspark