Depending on the role in question, a few common questions that I have faced are listed below, and I've added some that seem inspired from them. I have used Java for coding, but you should be able get the gist of it.
Fibonacci:
public
static int fibonacci(int n)
{
if (n<=1)
return 1;
else return fibonacci(n-1) +
fibonacci(n-2)
}
OR
public
static int fibonacci(int n)
{
if (n=0) return 0;
if (n=1) return 1;
else return fibonacci(n-1) +
fibonacci(n-2)
}
Factorial:
public
static int factorial(int n)
{
if (n=1) return 1;
else return n X factorial (n-1);
}
Multiplication:
public
static int multiply(int m, int n)
{
if (n =1) return m;
else return m X multiply(m, n-1)
}
Division:
public
static int divide (int dividend, int divisor)
{
if ((dividend-divisor)<0) return 0;
else return 1 + divide
(dividend-divisor, divisor)
}
Sum:
public
static int sum(int n)
{
if (n==0) return 0;
else return n + sum(n-1)
}
Power:
public
static int power(int base, int exponent)
{
if (exponent==0) return 1;
else return base X power(base,
exponent-1)
}