On a structural level, the properties featured by a majority of mechanical metamaterials can be ascribed to the finite number of soft internal degrees-of freedom allowing for low-energy deformations. Ideally, these low-energy deformation modes can be represented through mechanisms consisting of movable rigid geometrical units. Conversely, these mechanisms also serve as an intuitive starting point to initiate and adapt the design of mechanical metamaterials to requirements. Traditional design methods mainly comprising trial and testing can only well handle simple design tasks, not to mention that the final designs can be periodic and non-generic. In order to solve complex design problems, computer algorithm based inverse strategies provide state-of-the-art solutions. One way in which they can be utilized is by framing the material design problem as an optimization problem, where we optimize the values of control parameters (design variables) - in order to meet the desired target response. In this thesis, we present novel inverse strategies to design 2D mechanical metamaterials, whose zero-energy deformations can be modeled by one degree-of-freedom mechanisms consisting of pin-jointed polygons. We demonstrate that by optimizing the characteristic trajectory of these mechanisms, one can design generic metamaterials that exhibit complex programmable mechanics, atypical zero-energy deformations and shape-transformable behavior.