From my own experience - you can run the 11-36 11-speed SRAM cassette with medium cage SRAM derailleur. Just make sure you adjust the B-screw out quite far. On some set-ups you need to reverse the B-screw by taking it out and inserting it on the other side of the hole, just to give you a few more millimetres clearance.
The derailleur will be a bit stretched on a large-large, but it won't be ripped off. Best not to cross-chain much.
If you're using Shimano this is what it will look like:
View: https://www.youtube.com/watch?v=T9q4WpaqwgI
It will look pretty much the same if you are using SRAM shifters and mid-cage derailleur. If you really want to be safe then you can replace the SRAM road mech with a 1:1 MTB mech. As long as it is not an X-clutch version it will be compatible with the shifters. The beauty of SRAM, for me, is that it takes me about 60 minutes max to switch between the following set-ups, without needing to adjust brakes or shifters:
- 50/34T with 11-32 (for my sportives)
- 50/34T with 11-36 (for my touring)
- 38T 1x with 11-42 (for more extreme hills)
I only need to adjust the b-screw on my rear derailleur for each, plus when shifting between 1x and 2x I adjust my front derailleur's limit screws.