Solving a multi variable polynomial
a + b^2 + c^3 + d^4 &lt;= S
  For above equation ,I need to count possible solutions.
  
  I tried following approach.

Integer inp=Integer.parseInt(br.readLine());
      // get maximum possible value of b,c,d which satisfy equation
      int b=(int) Math.sqrt(inp);
        int d=(int) Math.sqrt(b);
        int c=(int) Math.cbrt(inp);
        int count=0;

  
  ...


If I were the interviewer, I would already have marked you down heavily for your choice of variable names. The problem statement defines a, b, c, d, S. The natural choice of variable names for those values are a, b, c, d, S. Using b, c, d for something else almost looks as though you were deliberately trying to make the code unmaintainable.



                        if(total&lt;=inp) {
                            count++;
                        }


Enumerating items one by one is nearly always the wrong way to count something.

If I asked you to count solutions to \$a \le S\$ would you write a loop? I hope not, because you can do it without any loop or any mathematical operations.

Now, how about \$a + b^2 \le S\$? This can be done with one mathematical expression. Hint: start from $$\sum_{b=0}^{\sqrt{S}} \textrm{countA}(S - b^2)$$

Cubes already grow quite fast, so

for (int c = 0; c &lt;= maxC; c++) {
    for (int d = 0; d &lt;= maxD; d++) {
        count += countAB(S - c*c*c - d*d*d*d)
    }
}


would be reasonably efficient. If you really want to microoptimise you can eliminate the multiplications in favour of some accumulators and addition, but that's probably not necessary for an interview question. They might ask about it in a follow-up.