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

  • All topics
  • 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 20 November 2026

GamifiedGamified challengesPracticeRaceLeaderboardPricing
Log inStart free
Gamified challengesGrid Challenge

Gamified challenge · Asked in Capgemini

Grid Challenge

A pattern of dots fills a rectangular grid: grid[r] is row r, where # is a dot and . is empty. Fold it over its vertical middle line and see whether the halves match; then fold it over its horizontal middle line.

Write symmetry(grid) that returns "vertical" if it mirrors left to right, "horizontal" if it mirrors top to bottom, "both" or "none". For ["#...#", ".#.#.", "..#.."] that's "vertical": every row reads the same backwards, but the top row isn't the bottom row.

Sign in to play Grid Challenge

This game is part of the paid plans. Sign in, then pick a plan to write your answer, watch it play out, and step through the algorithm with its guide.

Sign in with Google

or log in with email · create an account