Can the alternative hypothesis depend on the sample size? Suppose that we want to test:
$$H_0: \theta = 0 \,\,\, vs. \,\,\, H_1:\theta = 1/n,$$
where $n$ is the sample size used to test the hypothesis, and the sample used for this is $X_i \sim f(;\theta)$. Is it valid to state an alternative hypothesis which is sample size dependent?
 A: No. Why would the value of $\theta$ - a parameter of the distribution of the population depend on the number of observations in the sample that you draw from the population? Only the power of the test depends on the sample size but the parameter was determined before you drew your sample.
A: It's rare for the alternative hypothesis to take on a single value. Typically it represents a range of values, often the complement of the set of values listed for the null hypothesis. 
That said, it is possible for a hypothesis to be about a parameter that describes a sample when that sample is the population. I'll provide a toy example for which your hypotheses directly apply, but in the research I do, sample or individual parameters appear in (at least) two places:


*

*Estimating the sample average treatment effect in causal inference. The potential outcomes are missing for individuals, and the value of the missing potential outcome for each individual is a parameter. The mean of the potential outcomes under treatment and under control are also parameters. These values do not describe a population but rather just the sample. They are still parameters and they are still estimated.

*Estimating scale scores in factor analysis. Each individual has a value for a latent variable that is unobserved. We are interested in estimating those values for those individuals. For each individual, we assume the factor score is drawn from some distribution, but the parameter of interest refers to the value for an individual.
For your example, consider the following. You have a population of $n$ units, which is also your sample. You are interested in the value of a latent variable $\theta$, which is the same for each individual, and represents the proportion of a cake eaten by that individual. If no cake is eaten, $H_0: \theta = 0$. If any cake is eaten, $H_1: \theta = 1/n$, because everyone eats the same amount of cake. To estimate $\theta$, you ask each individual whether they are hungry or not. The proportion of hungry people is the test statistic for your test. If that proportion is greater than .5, we fail to reject the null hypothesis. Otherwise we reject the null hypothesis.
Hopefully it's clear that this example concerns the testing of a hypothesis about the unknown value of a parameter, and hopefully it's clear that under the alternate hypothesis the value of the parameter depends on $n$. This is of course an unrealistic toy example, but my understanding is that there is nothing preventing a hypothesis from being written as you have written it. You would likely never find such a hypothesis in an applied research question (mostly for the reason I mentioned in my first paragraph), but it is logically possible.
A: I read the previous answer and comments but still I think there is something else there. I consider a sampling distribution. A sampling distribution has n, the number of samples as parameter. It is a statistic and if we want to draw inferences about the sampling distribution itself, and not about an eventual distribution which it approximates, by virtue of central limit theorem or whatever, I see a case for you hypothetical situation. Consider for example Kolmogorov–Smirnov test where we use a sampling distribution. I think of course that using samples to draw inference on populations is not possible, and I agree to comments
