Interview Q&A / Aptitude

BeginnerQuick answer1 min readUpdated 3 Oct 2026

What is the unit digit of 7^95?

SHORT ANSWER

The answer is 3. Unit digits of powers of 7 repeat in a cycle of four (7, 9, 3, 1). 95 leaves remainder 3 when divided by 4, so 7^95 ends like 7^3, which ends in 3.

Explain it simply

You cannot multiply 7 by itself 95 times in an exam, and you do not need to. Only the last digit of each product affects the next last digit, so the last digits fall into a loop. Think of a ceiling fan with four blades: after every four turns the same blade comes back to the top. Find the length of the loop, then find where in the loop the power lands.

Example

Question: Find the unit digit of 7^95.

  1. Write the first few powers, last digit only: 7^1 ends in 7, 7^2 = 49 ends in 9, 7^3 = 343 ends in 3, 7^4 = 2401 ends in 1. Then 7^5 ends in 7 again.
  2. The cycle is 7, 9, 3, 1, length 4.
  3. 95 / 4 = 23 remainder 3. So 7^95 behaves like 7^3.
  4. Unit digit = 3.

If the remainder had been 0, you would take the 4th item of the cycle (1), not the 0th.

js
let d = 1;
for (let i = 0; i < 95; i++) d = (d * 7) % 10;
console.log(d); // Output: 3

What to say in the interview

"Unit digits of powers repeat. For 7 the cycle is 7, 9, 3, 1, so I divide the power by 4. 95 leaves 3, so the answer matches 7 cubed, which ends in 3. Digits 2, 3, 7 and 8 have cycle 4; 4 and 9 have cycle 2; 0, 1, 5 and 6 never change."

Common mistakes

  • Treating remainder 0 as the first term of the cycle instead of the last.
  • Using the cycle of the full base instead of only its last digit, for example for 127^95 use the cycle of 7.

#aptitude#number-system#cyclicity

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.