Let $C$ be a category with finite hom-sets.
Suppose that $X$ and $Y$ are objects in $C$ such that $C(Z,X)\cong C(Z,Y)$ for any Z (with no naturality condition).
For which categories $C$ does it follow that $X \cong Y$?
(Of course, it is true for posets).


A somewhat related question is the following.


Let $C$ be a symmetric monoidal closed category.
Suppose that $X$ and $Y$ are objects in $C$ such that $[X,Z]\cong [Y,Z]$ for any Z (with no naturality condition).
For which categories $C$ does it follow that $X \cong Y$?



When is an object determined by the number of maps from the other objects?
The first question is the main topic of two recent papers:


* Reggio's [Polyadic Sets and Homomorphism Counting](https://arxiv.org/abs/2110.11061), which is also a good reference for previous results in the literature (including that of Pultr mentioned in the comments). In particular, see Theorems 4.3, 5.10, and 5.12, the latter of which generalise beyond locally-finite categories.
* Fujino–Matsumoto's [Lovàsz's hom-counting theorem by inclusion-exclusion principle](https://arxiv.org/abs/2206.01994). In particular, see Theorems 2.11 and 2.12.


As far as I understand, the theorems give orthogonal sufficient conditions: it's unclear whether there is a general theorem subsuming both.


I don't believe there are answers for enriched categories yet.


