Interview Q&A / Aptitude

BeginnerQuick answer1 min readUpdated 3 Oct 2026

How many 4-digit numbers can be formed using the digits 0, 1, 2, 3, 4 and 5 without repetition?

SHORT ANSWER

300. The first digit cannot be 0, so it has 5 choices. The remaining three places use the other 5 digits: 5 x 4 x 3. Total = 5 x 5 x 4 x 3 = 300.

Explain it simply

Fill the places one at a time and multiply the choices. Handle the place with a restriction first. A 4-digit number cannot begin with 0, so the thousands place gets first treatment. After that, 0 is allowed again, and each place just has one fewer digit available.

Example

Question: 4-digit numbers from 0 to 5, no repetition.

  1. Thousands place: 1 to 5, so 5 choices.
  2. Hundreds place: any of the remaining 5 digits (0 is now allowed).
  3. Tens: 4 choices. Units: 3 choices.
  4. Total = 5 x 5 x 4 x 3 = 300.

Check: all 4-digit strings without repetition = 6 x 5 x 4 x 3 = 360. Those starting with 0 = 5 x 4 x 3 = 60. 360 - 60 = 300.

js
let count = 0;
for (let n = 1000; n <= 9999; n++) {
  const s = String(n);
  if ([...s].every(d => d <= "5") && new Set(s).size === 4) count++;
}
console.log(count); // Output: 300

What to say in the interview

"The first digit can't be zero, so 5 choices, and then 5, 4, 3 for the rest. That's 300, and 360 minus the 60 strings starting with zero agrees."

Common mistakes

  • Giving 6 choices to the first place and answering 360.
  • Giving only 4 choices to the second place, forgetting that 0 becomes available there.

#aptitude#permutations-combinations#counting

Related questions

Practise more Aptitude questions

Test your recall with short answers, then return to the detailed explanations when you need context.

Open Aptitude quick answers →

Get new questions like this by email

One short email when something new and useful lands. No spam, unsubscribe in one tap.

By subscribing you agree to the Privacy Policy.