InterviewDigestInterviewDigest

OA Practice Workspace

Coding Assessment2026-08-12

Pattern printing problem

AI-Expanded — inferred from the question title, not from the original candidate report

Given an integer $n$, write a function that prints a diamond-shaped pattern consisting of asterisks with a total height of $2n-1$ rows. The pattern should be perfectly centered, with the widest row containing $2n-1$ asterisks and the top and bottom rows containing a single asterisk.

Context & Summary

Offline round with 3 questions covering simple if-else logic, SQL query with join, and pattern printing. Difficulty was easy to moderate. Candidates solving at least 2 questions advanced to the technical interview.

💻 Coding practice works best on desktop.
Code editors are too cramped on mobile screens.