This is an image from an old exam I'm working through. Through the UML-diagram, as seen above, how can I determine if this is Command Pattern or Strategy Pattern?
The answer to the question is that is is Command Pattern and Composite Pattern. Clearly, it is Composite because of Block have multiple aggregations for Statement. I understand that it is Command Pattern since they use execute() in an interface which then is implemented in several subclasses, altough couldn't this technically also be seen as Strategy Pattern?
I don't really understand the difference between the two of them in concrete code, as I tend to see it as the same code just used in different ways, thus an UML-diagram would therefore be able to be either Pattern. In this case though, answering Strategy would give less points than Command Pattern.

This is in reality a variant of the interpreter pattern, where the
interpret()operation is calledexecute()and the context is either not needed or managed in a different way.The self association is used at implementation level for those
Statementthat are not terminal leaves, i.e. can be made of several otherStatement.The pattern is identified by its purpose, i.e. representing a grammar of a language (here statements, block-statements, print-statements) that allows to interpret/execute the statements.
As explained in GoF, the interpreter pattern is a specialization of the composite pattern (because of its structure that can be processed uniformly). So the answer composite is correct, but it is only part of the picture.
You could argue for the command pattern, and it can be defended. Indeed, GoF mentions the possibility of a macro-command that is an aggregation of several simple commands. However, it doesn't show it as an essential feature of that pattern. Moreover a key feature of the command pattern is to separate construction from invocation, and these elements are not mentioned here at all. Chosing command would not be wrong, but prefering it over interpreter would miss the real purpose of this construct for your particular and explicit example.
The strategy pattern has the purpose of encapsulating algorithms and make then interchangeable. The key of this pattern is that a context (object influenced by the strategy) associated with the strategy which is not shown here. Moreover, hierarchical breakdown is not common. So overall it'd be a poor fit.
P.S: As explained by qwerty_so in the comments, the white diamond is no longer useful in modern UML as its semantics are not defined in the UML specifications, and as it therefore doesn't add anything compared to a simple association (see this question for all the details).