Assumption : No water is spilled
Let 3L container be A. 5L container be B.
1. Fill A with water to the brim. That gives 3L of H2O.
2. Pour all the water from A into B.
3. Fill A with water to the brim.
4. Pour water from A into B to fill B to the brim. Now B have 5litres of H2O and A 1 litre.
5. Pour away all water in B. B is empty now.
6. Pour the 1 litre of H2O from A into B. B have now exactly 1 litre of water.
7. Fill A with water to the brim. A now have 3 litres of H2O.
8. Pour 3 litres of water from A into B. B now have exactly 4 litres of water.
Now, have a toast and empty B
cheers