Slice eggplant into ½-inch rounds. Sprinkle both sides evenly with salt and place slices in a colander. Let sit for 30 minutes to draw out moisture. Rinse under cold water and pat completely dry with paper towels.
1 large eggplant, to taste salt
Heat 2 tablespoons olive oil in a large skillet over medium heat. Fry eggplant slices in batches without crowding the pan, about 3-4 minutes per side, until golden brown and caramelized. Transfer cooked slices to a paper towel-lined plate and set aside.
1 large eggplant, ¼ cup olive oil
In a medium saucepan, heat remaining 2 tablespoons olive oil over medium heat. Add minced garlic and cook for 30 seconds until fragrant, being careful not to burn it. Add chopped tomatoes, season with salt and black pepper, and simmer uncovered for 15-20 minutes, stirring occasionally, until the sauce thickens but remains saucy.
3 cloves garlic, 1.5 lbs ripe tomatoes, ¼ cup olive oil, to taste salt, to taste black pepper
Bring a large pot of salted water to a boil. Cook spaghetti for 8-10 minutes until al dente. Drain pasta, reserving 1 cup of the pasta cooking water.
12 oz spaghetti, to taste salt
Add cooked pasta to the tomato sauce off heat and toss to coat evenly. Gently fold in the fried eggplant. If the sauce is too dry, add reserved pasta water 2 tablespoons at a time until desired consistency is reached. Top with torn fresh basil and grated ricotta salata just before serving. Add red pepper flakes if desired.
1 large eggplant, 12 oz spaghetti, ⅓ cup ricotta salata, to taste fresh basil leaves, optional red pepper flakes