employer cover photo
employer logo
employer logo

Briskminds Software Solutions

Engaged Employer

Briskminds Software Solutions Interview Question

Star Pattern using Java and Collection Framework

Interview Answer

Anonymous

May 5, 2026

public class main { public static void main(String[] args) { int n = 5; List pattern = new ArrayList(); for (int i = 1; i <= n; i++) { pattern.add("*".repeat(i)); } pattern.forEach(System.out::println); } }