GamifiedGamified challengesPracticeRaceLeaderboardPricing

Learn data structures by watching them move, then doing it yourself. Press M anytime to toggle sound.

A product of Amypo Technologies, Coimbatore.

Learn

  • Fundamentals & OOPs
  • Data structures and algorithms
  • Aptitude
  • Learning path
  • How it works
  • About dotprep

Practice

  • Practice arena
  • Daily challenge
  • Gamified challenges
  • Race mode
  • Leaderboard

Interview prep

  • Java interview
  • Coding questions
  • Company questions
  • System design
  • Jobs & careers

You

  • Dashboard
  • Settings
  • Pricing
  • Create account

© 2026 dotprep

Content last updated 27 November 2026

GamifiedGamified challengesPracticeRaceLeaderboardPricing
AptitudeLogical reasoning · Visual and Diagrammatic Reasoning

Cubes and Dice

Count the painted unit cubes of a sawn cube, and read opposite faces, neighbours and hidden sums of a die from the positions it is shown in.

6 min read 45 questions
Practice questions

On this page

1/10
  1. 011. What cube and dice questions test
  2. 022. The painted cube: four counts
  3. 033. Painted cube, worked
  4. 044. When only some faces are painted
  5. 055. Dice: faces, opposites and neighbours
  6. 066. Reading a die from two or three positions
  7. 077. Hidden faces and sums
  8. 088. Traps and shortcuts
  9. 099. Revision sheet
  10. 10Practice
Back to top

1. What cube and dice questions test

These questions give you a solid cube cut into small cubes, or a die shown in one or more positions, and ask you to count or deduce something you cannot read off directly. They reward a clear mental picture of a 3-D object and a little careful counting — never guesswork.

There are two families. Painted cubes: a big cube is painted and sawn into unit cubes; you count how many small cubes carry paint on three, two, one or no faces. Dice: a cube carries the numbers 1 to 6; from one or more drawn positions you work out which number faces which, or sums of hidden faces.

  1. For painted cubes, learn the four counting rules below — they turn every question into a one-line calculation.
  2. For dice, the key fact is that each face has exactly four neighbours and one opposite; name the neighbours and the opposite falls out.

2. The painted cube: four counts

A cube is painted on all six faces and cut into n×n×n unit cubes. Peel your eyes to the position of a small cube — corner, edge, face-centre or deep inside — and the number of painted faces follows.

Where the small cube sitsPainted facesHow manyFor n = 4
At a corner38 (always)8
Along an edge, not a corner212 × (n − 2)24
In the middle of a face16 × (n − 2)²24
Hidden inside0(n − 2)³8
Everything—n³64
4×4×4 cube
Each face is divided into 4×4 = 16 small squares; the whole cube is 4³ = 64 unit cubes.

The four counts always add back to n³. For n = 4: 8 + 24 + 24 + 8 = 64. If your four numbers do not sum to n³, one of them is wrong — a built-in check worth doing every time.

The 8 (corners), 12 (edges) and 6 (faces) are just the cube’s own 8 corners, 12 edges and 6 faces. Remember the object, not the formula, and you will never mix them up.

3. Painted cube, worked

Example. A 4 cm cube is painted and cut into 1 cm cubes. How many small cubes have exactly two faces painted?

Two-face cubes live along the edges, away from the corners. Each edge of the big cube is 4 small cubes long, and the two at its ends are corners, leaving 4 − 2 = 2 in the middle. A cube has 12 edges, so 12 × 2 = 24 small cubes have two painted faces.

The same picture answers the others at once: 8 corner cubes (three faces), 6 × 2² = 24 face-centre cubes (one face) and an inner 2×2×2 block of 8 unpainted cubes. Check: 8 + 24 + 24 + 8 = 64.

When a side is given in centimetres, n is the number of cuts per edge, i.e. the side length divided by the small-cube edge. A 6 cm cube cut into 2 cm cubes has n = 3, not 6.

4. When only some faces are painted

Harder questions paint only some faces — a cube resting on the floor is not painted underneath, or two opposite faces are left plain. The four standard formulas no longer apply, so count from first principles: a small cube gets one mark of paint for each painted big-face it touches.

4-cube, 4 faces painted
Front and back are left unpainted (unshaded); the other four faces are painted.

Example. A 4-cube is painted on four faces only — the front and back are left plain — then cut into unit cubes. Because a pair of opposite faces is bare, no small cube can show three painted faces, so that count is 0. Counting the rest gives 16 with two faces, 32 with one and 16 with none, and these still add to 64.

The trick is that a cube on an unpainted face loses the paint that face would have given it. A former corner that sits on a plain face now shows only two painted faces, and so on. Work along each kind of position and recount; do not reuse 8, 12(n−2) …

5. Dice: faces, opposites and neighbours

A die is a cube numbered 1 to 6. The six faces split into three opposite pairs; the two faces of a pair never share an edge. On an ordinary die the opposite faces add to 7 — so 1–6, 2–5 and 3–4 — but test dice are often non-standard, and then you must read the opposite from the positions shown.

An ordinary die unfolded. Faces two apart in a straight line are opposite: here 1–6, 2–5 and 3–4.

Every face touches four others (its neighbours) and misses just one (its opposite). That single fact solves most dice questions: if you can see a face sitting next to four different numbers across the positions, the fifth number is its opposite.

The pip patterns for 1 to 6. Reading pips quickly saves time under exam pressure.

6. Reading a die from two or three positions

You are shown the same die turned into different positions and asked what lies opposite a given number. Method: list, for the chosen number, every number seen touching it. Those are its neighbours; the one number that never appears beside it is the opposite.

III
Two positions of one die. What is opposite 2?

Example. The number 2 appears in both positions. Reading the faces that share its corner, 2 is seen next to 1, 3, 5 and 6. That is all four neighbours, so the remaining number, 4, is opposite 2.

Two positions are usually enough when the chosen face appears in both. If a number shows up in only one position you may see only two of its neighbours — then use a third position, or track a different face whose neighbours are all visible.

A common trap: assuming opposite faces add to 7. That holds only for an ordinary die. If the question says the die is not standard, or the drawn numbers already break the rule, deduce the opposite from the positions, not from 7.

7. Hidden faces and sums

The six faces always total 1 + 2 + 3 + 4 + 5 + 6 = 21. This gives two instant results, true for any die, standard or not.

  • Hidden faces. If three faces are visible, the three you cannot see total 21 minus the visible sum.
  • Neighbours of a face. The four faces adjacent to a face X total 21 − X − (opposite of X). On an ordinary die the opposite is 7 − X, so the four neighbours always total 21 − X − (7 − X) = 14.

So on an ordinary die the four faces around any face add to 14 — a handy check. On a non-standard die, first find the opposite from the positions, then subtract both it and X from 21.

8. Traps and shortcuts

  • Mixing up the multipliers: three faces → 8 corners, two faces → 12 edges, one face → 6 faces. Picture the cube.
  • Using n where you need n − 2. Only the inner cubes (edges, face-centres, core) use n − 2; the 8 corners never change.
  • Side length versus number of cuts: convert to n = side ÷ small-cube edge before using any formula.
  • Assuming opposite faces sum to 7 on a die the question calls non-standard.
  • Forgetting the sum-to-n³ check on painted cubes, and the sum-to-21 check on dice.

Fast checks

  • Painted cube: compute all four counts and confirm they add to n³.
  • Dice: the opposite of a face is the only number you never see touching it across the positions.

9. Revision sheet

QuestionUse
Small cubes with 3 painted faces8 (the corners)
Small cubes with 2 painted faces12 × (n − 2)
Small cubes with 1 painted face6 × (n − 2)²
Small cubes with 0 painted faces(n − 2)³
Total small cubesn³ (and the four counts sum to it)
Some faces unpaintedcount cube by cube; one mark per painted face touched
Opposite face, ordinary die7 − X
Opposite face, non-standard diethe number never seen beside X
Sum of hidden faces (3 shown)21 − (sum of visible faces)
Sum of the four faces around X21 − X − (opposite of X); 14 on an ordinary die

Practice

45 questions in 3 sets. Every answer comes with its explanation, and each question you get right earns XP.

  • Easy · 15
  • Medium · 15
  • Hard · 15
Start practising
PreviousLogical Venn DiagramsNextMirror and Water Images
Log inStart free