What is the asymptotic running time of the following piece of code?
An easy way to intuit asymptotic notations goes like this. Say you have a number $n$ and a constant $c$. Now $n^2$ will always be greater than $n*c$ for any choice of $c$ where $c &lt; n$. So no matter what the constant coefficient is, it will never exceed $n^2$.

Now your question. Asymptotic notations are calculated for sufficiently large values of n where sufficiently large is usually taken as infinity. So although your algorithm has $n^3$ and $n$ time complexities for smaller values of $n$, for large values ($n$ tends to infinity), the time complexity is $n^2$.