  We study systems of polynomial equations in several classes of finitely
generated rings and algebras. For each ring $R$ (or algebra) in one of these
classes we obtain an interpretation by systems of equations of a ring of
integers $O$ of a finite field extension of either $\mathbb{Q}$ or
$\mathbb{F}_p(t)$, for some prime $p$ and variable $t$. This implies that the
Diophantine problem (decidability of systems of polynomial equations) in $O$ is
Karp-reducible to the same problem in $R$. In several cases we further obtain
an interpretation by systems of equations of the ring $\mathbb{F}_p[t]$ in $R$,
which implies that the Diophantine problem in $R$ is undecidable in this case.
Otherwise, the ring $O$ is a ring of algebraic integers, and then the
long-standing conjecture that $\mathbb{Z}$ is always interpretable by systems
of equations in $O$ carries over to $R$. If true, it implies that the
Diophantine problem in $R$ is also undecidable.
  Some of the classes of f.g. rings studied in this paper are the following:
all associative, commutative, non-unitary rings (a similar statement for the
unitary case was obtained by Eisentraeger); all possibly non-associative,
non-commutative non-unitary rings that are f.g. as an abelian group; and
several classes of f.g. non-commutative rings. Analogous statements are
obtained for algebras over f.g. associative commutative unitary rings.
  Another contribution is the technique by which the aforementioned results are
obtained: We show that given a bilinear map $f: A\times B \to C$ between f.g.
abelian groups (or modules), under mild assumptions, there exists a certain
ring (or algebra) $R$ with nice properties which is interpretable by systems of
equations in the multi-sorted structure $(A,B,C;f)$. This result is not only
relevant for rings and algebras, but also in other structures such as groups,
as demonstrated previously by the authors.
