Place flour, butter, egg, sugar, baking powder and salt in the bowl of a food processor fitted with a blade.
Pulse several times until it resembles coarse meal (pea-sized bits). After that process just until a ball of dough forms. If it's too dry to come together, add a tablespoon of icy cold water or sour cream (only if you have to though).
Transfer the dough ball onto a piece of plastic film, wrap tightly and place in the fridge for one hour.
Preheat the oven to 350 degrees Fahrnheit. Grease a 7 x 11-inch rectangular baking dish with a little butter and line with parchment paper. Butter helps the paper stick to the dish. Set aside.
While the dough is chilling, peel and core the apples.
Grate the apples using the food processor or a hand grater and transfer to a large bowl. Add cinnamon and mix to incorporate.
After 1 hour, take the dough ball out of the freezer and cut ⅔ of it into a few ¼-inch thick slices. Place the remaining ⅓ of dough in the freezer - you will use it to grate on top of the cake.
Place th dough slices on the bottom of the prepared baking dish, then press with your fingers to form an even layer.
Using clean hands or a cotton kitchen towel, squeeze out most of the juice from grated apples and place it on top of the dough layer. Do it in batches until all apples are used up. Then press lightly with your hands or a spoon to even out.
Take the remaining ⅓ of dough from the freezer, grate and place on top of the apples in an even layer.
Place in preheated oven and bake for 60-70 minutes until golden brown.
Let cool for at least 30 minutes (or completely) and dust the top with powdered sugar.
Cut into 12 squares and serve warm or at room temperature.