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

Counting of Figures

Count the triangles, rectangles, squares, parallelograms and straight lines hidden in a composed figure by working through the shapes one size at a time.

5 min read 45 questions
Practice questions

On this page

1/10
  1. 011. What figure-counting questions test
  2. 022. Counting triangles
  3. 033. Counting rectangles in a grid
  4. 044. Counting squares in a grid
  5. 055. Counting parallelograms
  6. 066. Counting straight lines
  7. 077. Overlapping and nested figures
  8. 088. Common traps
  9. 099. Revision sheet
  10. 10Practice
Back to top

1. What figure-counting questions test

You are shown one figure made of straight lines and asked how many triangles, rectangles, squares, parallelograms or straight lines it contains. The figures look simple, yet a quick glance almost always undercounts: the overlapping and nested shapes are easy to miss. The test is really one of being systematic — of counting in a fixed order so that nothing is seen twice and nothing is left out.

There is one habit that solves every one of these questions: count by size. Count the smallest pieces first, then the shapes made of two pieces, then three, and so on up to the whole figure. Add the groups at the end. Guessing or counting at random is what the wrong options are designed to catch.

  1. Label the corners or key points lightly in your mind so you can name each shape.
  2. Count one size of shape completely before moving to the next size.
  3. Keep a running tally per size, then add — never hold the whole total in your head at once.

2. Counting triangles

Triangles are the most common and the trickiest, because they overlap. Take the smallest triangles first, then join neighbours into bigger ones.

Worked example — a fan of cevians. The figure below is a triangle whose apex is joined to the two interior points on the base. Counting by size: 3 smallest triangles side by side, then the ones made of two adjacent small triangles, then the single whole triangle.

There is a shortcut. With the 2 base ends plus the cevian feet there are 4 points on the base; any 2 of them plus the apex give a triangle, so the count is C(4,2) = 6. In general, k cevians give C(k+2, 2) triangles.

Worked example — a rectangle with both diagonals. The diagonals cross at the centre and make 4 small triangles; each diagonal also splits the rectangle into 2 big triangles, another 4. That is 8 triangles in all.

3. Counting rectangles in a grid

A rectangle is fixed the moment you choose its left and right edges (two vertical lines) and its top and bottom edges (two horizontal lines). So in a grid you do not trace rectangles at all — you count ways to pick the lines.

Worked example. The grid above has 4 vertical lines and 3 horizontal lines. Choose 2 verticals in C(4,2) = 6 ways and 2 horizontals in C(3,2) = 3 ways. Every such pair bounds exactly one rectangle, so there are 6 × 3 = 18 rectangles — far more than the 6 small cells you see at first.

Lines each wayRectanglesLines each wayRectangles
2 and 214 and 318
3 and 234 and 436
3 and 395 and 330

C(m,2) = m(m − 1)/2. So lines 2,3,4,5,6 give 1, 3, 6, 10, 15 pairs. Memorise this short list and grid rectangle questions become one multiplication.

4. Counting squares in a grid

Squares are rectangles with equal sides, so the line-pair formula over-counts them (it includes long rectangles). Count squares by side length instead.

Worked example. In the 3×3 grid above, the number of t×t squares is (4 − t)² for each side length t. So 1×1: 9, 2×2: 4, 3×3: 1. Total = 9 + 4 + 1 = 14.

In a c×r grid the number of t×t squares is (c − t + 1)(r − t + 1); add this over every t from 1 up to the smaller of c and r. A 4×3 grid gives 12 + 6 + 2 = 20 squares, for instance.

5. Counting parallelograms

A parallelogram only needs two pairs of parallel sides — right angles are not required. When a grid is slanted, the rectangle method still works: pick two lines from each of the two directions.

Worked example. The slanted grid above has 3 lines going across and 3 going up-and-across. Choosing 2 of each gives C(3,2) × C(3,2) = 3 × 3 = 9 parallelograms. Note there is not a single rectangle here, because no two lines meet at a right angle.

A square and a rectangle are themselves parallelograms. If a question asks for parallelograms in a plain (unslanted) grid, every rectangle counts as one too.

6. Counting straight lines

Here you count complete straight lines, not the little pieces between crossings. A line that other lines cross is still one line. Trace each line from one end to the other and tick it once.

The rectangle-with-diagonals above is made of 6 straight lines: the 4 sides and the 2 diagonals. The centre point where the diagonals cross does not add a line. In a c×r grid the count is simply (c + 1) + (r + 1).

7. Overlapping and nested figures

The hardest figures put shapes on top of one another. Two tools handle them: count by size as always, and watch for a shape made by combining smaller ones across the overlap.

Six-pointed star. The star above is two large triangles laid across each other. Count the 2 large triangles, then the 6 small points, for 8 triangles. Students who see only the points answer 6 and lose the mark.

Triangle with its medial triangle. Joining the midpoints of the sides gives 1 outer triangle, 1 middle triangle and 3 corner triangles: 5 in all. The middle triangle is easy to forget because it points the other way.

8. Common traps

  • Counting only the smallest shapes. The small cells or small triangles are usually a minority of the answer; the combined shapes outnumber them.
  • Forgetting the whole figure. The biggest triangle or the full outer rectangle is one more shape — an easy +1 to drop.
  • Missing overlapping rectangles. In a grid, rectangles share edges and overlap; the line-pair count captures all of them, hand-tracing rarely does.
  • Miscounting straight lines. Count whole lines, not the segments between crossings.
  • Assuming right angles for parallelograms. A slanted shape with two pairs of parallel sides is still a parallelogram.

9. Revision sheet

FigureHow to count
Triangle with k cevians from a vertexC(k + 2, 2) triangles
Rectangle or square with both diagonals8 triangles
Triangle + medial triangle5 triangles
Six-pointed star8 triangles (2 big + 6 points)
Rectangles in a c×r gridC(c + 1, 2) × C(r + 1, 2)
Squares in a c×r gridΣ (c − t + 1)(r − t + 1) over t
Parallelograms in a slanted c×r gridC(c + 1, 2) × C(r + 1, 2)
Straight lines in a c×r grid(c + 1) + (r + 1)
Any figurecount by size, keep a tally per size, then add

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
PreviousFigure Series and Analogy
Log inStart free