Hive Context and SQL Context in Spark

shall we use Hive/SQL context to solve the question in spark(if i get question on older syllabus)?

If not how can we achieve

  1. savingthe RDD in JSON format.
  2. write query that produces ranked and sorted data using spark

With old syllabus Spark SQL and Data Frames are out of syllabus.