Is there a way to exclude an app from Doze?
This answer is based off my Nexus 9 on MRA58K. It should be similar for any app.

Follow the steps as given below:


Go to Settings &rarr; Battery
Tap on the top right 3-dot menu, and choose Battery Optimisation.
There should be a dropdown below the actionbar on the top left, choose All Apps from the list.
Find your app in the list (in this case, Whatsapp)
Tap on it. You will get a popup with 2 options, Optimise and Don't Optimise
Optimise should be selected by default.
Select "Don't Optimise", and press "Done" below.
That's it. I hope it works for you.