PPractick

DSA interview question

Pattern 16: Alpha Ramp

Easy · Algorithms · Topics: pattern building

The problem

In the alpha ramp, row i repeats the i-th letter i times: A, BB, CCC, and so on. It's the letter version of Pattern 4 (repeated row numbers), and it again highlights the difference between a value tied to the row and one tied to the column. Here every character in a row is the same, so the value depends only on the row.

Example for n = 4:

A
BB
CCC
DDDD

Function signature

vector<string> alphaRamp(int n);  // row i: the i-th letter repeated i times

Test cases

Input nOutput rowsExplanation
1"A"
3"A", "BB", "CCC"
5"A", "BB", "CCC", "DDDD", "EEEEE"Row i uses letter 'A' + i − 1

(Confirm: 1 ≤ n ≤ 26; letters without separators.)

How interviewers phrase it

Clarifying questions to ask

  1. Uppercase? N at most 26?
  2. Separators?
  3. Print or return?

Follow-ups to expect

  1. "Which letter goes in row i?"
  2. "Can you build a row without an inner loop?"
  3. "Complexity?"

Practise questions like this with a real engineer

On Practick another engineer interviews you live for 60 minutes on a question from this bank. They have the full interviewer guide beside the call: the expected answer to every follow-up, hints to give if you stall, and a scoring rubric. You get the model solution once the session settles. It is free: interview someone for an hour and you have earned your own.

Book a free mock interview

Related questions

All 474 dsa interview questions

DSA mock interviews · System design interview questions · Free mock interview practice · Browse interviewers · Sign in