Apple Sticky Toffee Pudding

Cake
Nonstick vegetable oil spray
2 lb. apples (such as Honeycrisp or Fuji; about 6), peeled, cored, cut into ½" pieces (about 4 cups)
2 Tbsp. (25 g) plus 1 cup (packed; 200 g) light brown sugar
1 Tbsp. plus ½ cup (1 stick) unsalted butter, room temperature
½ tsp. ground cinnamon
½ tsp. Diamond Crystal or ¼ tsp. Morton kosher salt, divided
1 cup (173 g) chopped pitted Medjool dates
¾ cup warm freshly brewed coffee
3 large eggs
1 tsp. vanilla extract
1½ cups (188 g) all-purpose flour
2 tsp. baking powder
1 tsp. baking soda
Sauce and assembly
1 cup heavy cream
1 cup (packed; 200 g) light brown sugar
½ cup (1 stick) unsalted butter
½ tsp. Diamond Crystal or ¼ tsp. Morton kosher salt
vanilla ice cream

Cake
Place a rack in middle of oven; preheat to 375°. Coat a 9" square baking pan with nonstick vegetable oil spray and line with parchment paper. Cook 2 lb. apples (such as Honeycrisp or Fuji; about 6), peeled, cored, cut into ½" pieces (about 4 cups), 2 Tbsp. (25 g) light brown sugar, 1 Tbsp. unsalted butter, room temperature, ½ tsp. ground cinnamon, and ¼ tsp. Diamond Crystal or ⅛ tsp. Morton kosher salt in a medium saucepan over medium heat, stirring occasionally, until apples are glossy and softened but not mushy, 8–10 minutes. Let cool.
Combine 1 cup (173 g) chopped pitted Medjool dates and ¾ cup warm freshly brewed coffee in a small bowl; let sit 10 minutes.
Meanwhile, beat remaining 1 cup (packed; 200 g) light brown sugar and ½ cup (1 stick) unsalted butter, room temperature, in the bowl of a stand mixer fitted with the paddle attachment on medium speed until light and fluffy, about 5 minutes. Scrape down sides of bowl with a rubber spatula. Increase speed to medium-low and, with motor running, add 3 large eggs one at a time, beating until combined after each addition. Beat in 1 tsp. vanilla extract. Reduce speed to low and mix in date mixture. (The batter will look broken at this point.)
Sift 1½ cups (188 g) all-purpose flour, 2 tsp. baking powder, 1 tsp. baking soda, and remaining ¼ tsp. Diamond Crystal or ⅛ tsp. Morton kosher salt into a medium bowl. Add 1 cup cooked apples and toss lightly to combine; set remaining cooked apples aside for serving. Add to brown sugar mixture in stand mixer bowl and gently fold with a rubber spatula until just combined.
Scrape batter into prepared baking pan; place pan on a rimmed baking sheet. Bake cake until a tester inserted into the center comes out clean, about 30 minutes. Transfer pan to a wire rack and let cake cool in pan 5 minutes.
Sauce and assembly
While the cake is baking, bring 1 cup heavy cream, 1 cup (packed; 200 g) light brown sugar, ½ cup (1 stick) unsalted butter, and ½ tsp. Diamond Crystal or ¼ tsp. Morton kosher salt to a simmer in a medium heavy saucepan over medium-low. Cook, stirring often, until sauce is shiny and thick enough to coat a spoon, 8–10 minutes.
Turn cake out of pan onto a platter and peel away parchment paper; discard. Pour ½ cup toffee sauce over and brush top and sides of cake to coat. Cut cake into squares and serve topped with a scoop of vanilla ice cream if desired and remaining cooked apples and toffee sauce.