Matricial representation of an operator in a certain Hilbert basis I'm asked to find the matrix that represents the operator
$\hat{Q} \psi (x) = e^{iQx} \psi (x), \ Q \in \mathbb{R}$
in the $\mathcal{L}^2_{[0,1]}$ basis
$\phi_k (x) = e^{i 2 \pi k x}, \ k \in \mathbb{Z}$.
First I thought of solving it by determining the inner products
$(\phi_k | \hat{Q} | \phi_l); \ k,l \in \mathbb{Z}$,
but I don't know if that's the right way to do it.

Yes, that's the right way to do it, and fairly straightforward too.
You have
\begin{align}
(\phi_k | \hat{Q} | \phi_l)
&=\int_0^1e^{iQx}e^{2i\pi l x}e^{-2i\pi k x}\,dx\\[0.3cm]
&=\int_0^1e^{i(Q+2\pi(l-k))x}\,dx\\[0.3cm]
&=
(\phi_k | \hat{Q} | \phi_l)=-i\,\frac1{Q+2\pi(l-k)}\,(e^{iQ}-1),
\end{align}
with the exception of the case where $Q\in 2\pi\mathbb Z$. In the case, when $k-l=Q/2\pi$ you get $$
(\phi_k | \hat{Q} | \phi_l)=1,
$$
and $(\phi_k | \hat{Q} | \phi_l)=0$ otherwise.
