Generally, if water that is seeping back into the dishwasher it is because the hose that discharges to the kitchen sink was not installed properly. Dishwasher hoses need to travel uphill from the dishwasher to the under-side of the counter top, then run downhill to the kitchen sink where it's tied in above the sink trap, creating an upward loop which prevents dishwasher plumbing problems like the one you’ve described. If the loop is up as high as possible under the kitchen sink, the water goes down the drain. If the dishwasher hose is installed correctly, then your dishwasher’s drain problems are likely caused by a malfunctioning inlet water solenoid valve. An appliance technician or licensed plumber should evaluate your dishwasher’s plumbing to ensure a proper diagnosis, then repair or replace the valve if necessary.