Sorting JSON items from a site So I recently applied to this job for iOS Developer and was invited to complete the following code challenge:

As a next step, please complete this coding exercise in order to proceed with our interview process. If you do well &amp; pass, you will be connected to a Software Engineer to discuss your exercise for an hour zoom video call. Take as much time as needed.
Problem statement:
Please write an (Android/iOS) app that retrieves the data from https://fetch-hiring.s3.amazonaws.com/hiring.json. This will return a json array of items. Using this list of items, display all the items grouped by &quot;listId&quot; to the UI. Sort the results first by &quot;listId&quot; then by &quot;name&quot; when displaying. Filter out any items where &quot;name&quot; is blank or null. The final result should be displayed to the user in an easy-to-read list.&quot;

My solution is here.
View Controller is as follows:
import UIKit



class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {

func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
    return tableData[section].count
}

@IBOutlet weak var dataTableView: UITableView!
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
    let cell = tableView.dequeueReusableCell(withIdentifier: &quot;DataViewCell&quot;, for: indexPath) as? DataCell
    cell?.textSpace.text=tableData[indexPath.section][tableIndices[indexPath.section][indexPath.row]]
    return cell!
}

func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -&gt; String? {
    return &quot;List ID: &quot;+String(section+1)
}

func numberOfSections(in tableView: UITableView) -&gt; Int {
    return tableData.count
}



var tableData: [[Int:String]]=[[:]]
var tableIndices: [[Int]]=[[]]

override func viewDidLoad() {
    super.viewDidLoad()
    
    
    URLSession.shared.dataTask(with: URL(string: &quot;https://fetch-hiring.s3.amazonaws.com/hiring.json&quot;)!)
                 {
                     data,response,error  in
                     
                    
                    let json=try? JSONSerialization.jsonObject(with: data!, options: []) as! [[String:Any]]
                    
                    for items in json!
                    {
                        if(type(of: items[&quot;name&quot;]!) != NSNull.self &amp;&amp; items[&quot;name&quot;]! as! String != &quot;&quot;)
                        {
                            let listID=Int(String(describing: items[&quot;listId&quot;]!))!
                          
                            while(self.tableData.count &lt; listID)
                            {
                                self.tableData.append([:])
                                self.tableIndices.append([])
                            }
                            
                            self.tableIndices[listID-1].append(Int(String(describing: items[&quot;id&quot;]!))!)
                            self.tableData[listID-1][Int(String(describing: items[&quot;id&quot;]!))!       ]=items[&quot;name&quot;]! as! String
                            self.tableIndices[listID-1].sort()
                            
                        }
                    }
                 
                     DispatchQueue.main.async {
                        self.dataTableView.delegate=self
                        self.dataTableView.dataSource=self
                        self.dataTableView.reloadData()
                         
                     }
            
                 }.resume()
                  

}


}

Two days after submitting, I got the following feedback:

The exercise featured a lot of Swift code that forced unwrapping instead of using nil safe paradigms such as let or guard, and the items displayed in the list would have benefited from a struct or class defining the object to better separate the business logic from the view controller.

Are they being too nit picky here, or is my code really that screwed up?
They're not being too nit-picky. DataTask's completion handler will return nil for data when it couldn't get the data, like when the network is offline.  Force unwrapping 'data' means you deliberately crash the application when that happens.  That would be bad.
&quot;separate the business logic from the view controller&quot;: They expect you to make a data type to parse the JSON into, perhaps like this:
struct Item: Decodable {
    let id: Int
    let listId: Int
    let name: String?
}