DSA interview question
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
vector<string> alphaRamp(int n); // row i: the i-th letter repeated i times
Input n | Output rows | Explanation |
|---|---|---|
| 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.)
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 interviewAll 474 dsa interview questions
DSA mock interviews · System design interview questions · Free mock interview practice · Browse interviewers · Sign in