I am a master's student in Germany and till date I have had two positions as a working student at different companies. In company 1, I was hired initially for 6 months with an unspoken understanding that based on performance, the contract could be extended or promoted to a paid thesis position. A problem I had here was that I was told "We need X task done" and I would do it based on what I learned and by asking questions but instead they expected that I fast-forward the process, not ask many questions and just do what was asked. Although I was not terminated, they often delayed giving me negative feedback only to say something when things got to such a point that all they had to report was negatives, and maybe a few positives so as not to hurt my feelings (I don't really care about feelings in the workplace). This contract was subsequently not renewed.
The fate of the second position is a bit similar and ended with me being terminated on the grounds that their expectations were different from what I was outputting. Fair enough.
My question is: What could I do to avoid such situations in the future so that I clearly understand what is expected of me and that my supervisor(s) has a clear picture of what I am able to do? In short, what are some techniques that I could work on which would help me bridge this chasm (I'll be honest here) of expectations?