I come up with the following set-theoretic question that has the flavor of Maximal Almost Disjoijnt (M.A.D.) families, although it is a bit different than the usual setting:

Let $\kappa$ be an uncountable cardinal. I want to find $\lambda$ such that:

1) there is a family of functions $f_\alpha:\lambda \rightarrow \kappa$, for all $\alpha< \lambda$,

2) for every $\alpha,\beta<\lambda$, $f_\alpha\cap f_\beta$ is finite (or empty), i.e. there are only finitely many $x\in \lambda$ such that $f_\alpha(x)=f_\beta(x)$, and

3) $\lambda$ is the greatest possible such cardinal.

Alternatively, we can see this family as one function $f:\lambda\times\lambda \rightarrow \kappa$ and the difference is that $\lambda$ controls both the domain of the functions as well as the number of them.

Now, it is trivial to construct a family of size $\kappa$ that satisfies (1) and (2) and it is not too hard to prove that it can not be done for $\lambda=\kappa^{++}$. So we are left we only two possibilities. Either $\lambda=\kappa$ is the best possible, or $\lambda=\kappa^{+}$ is the best possible.

Under the additional assumption $\kappa^\omega=\kappa$, we can prove that $\lambda=\kappa$ is the best possible.

My question: Does anyone know any references that relate to this question?