Let \(X_1,\ldots ,X_n\) be an i.i.d. sample from a uniform \((0,\theta )\) distribution, where \(\theta >0\).
(a) Find the maximum likelihood estimator \(\hat {\theta }\) for \(\theta \);
(b) Construct a \(100(1-\alpha )\%\) confidence interval for \(\theta \) based on \(\hat {\theta }\).