Hi Singh,
The first thing I would check is the air gap on top of the sink (if any).
Remove the cap and the top piece and check for any clog.
The second thing I would check is the check valve (#15 on the
pump & motor break down diagram).
Remove all water from the dishwasher, remove the bottom panel, disconnect the drain hose from the check valve and unscrew it. Check for any clog.
Here are the break down diagrams for the Whirlpool dishwasher
Model DU940PWKQ1 (basic model DU940PWK)
Good luck.
Gene.