Apple Interview Question

Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2024-12-06Added By Anonymous
Source: Link

Interviewer pasted this question and said do code it out in 20 mins this is the i/p coming from a csv data and then you have to write the driver function as well along with this and then make sure the code is comiling . Also no more hints were provided and there is nothing wrong with the question . Make sure you have 20 mins and you should compile the code as well

Question :

csvData="""

"entry1",2,3.6

"boots",5,1.7

"slack",1,2.6

"triffid",11,-1.5

"""


The data needs to be sorted numerically by the second column.


How would you go about sorting the entries and dumping the newly sorted data?

Comments