I know the working of PCA, but was baffled by question asked in the interview that:
Principal Component Analysis of variables $x$, $x^2$, $x^3$. How can we derive it mathematically?
Do we need to create matrix of it and then calculate covariance matrix?
Yes, you would just use your vector $x$ to make a matrix $[x, x^2, x^3]$ that can then be used for the standard PCA steps.