Oracle Interview Question for Senior Software Development Engineers


Country: India
Interview Type: In-Person




Comment hidden because of low score. Click to expand.
0
of 0 vote

for(int i=0;i<4;i++){

for(int j=0;j<2*i+1;j++){
System.out.print("*");
}
System.out.println();
}

- anu pachauri July 03, 2018 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

{for(int i=0;i<4;i++){

for(int j=0;j<2*i+1;j++){
System.out.print("*");
}
System.out.println();
}
}

- anu pachauri July 03, 2018 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

public void printStar(int size)
{
if(size <= 0) {
print("Incorrect size");
return;
}
for(int j=1; j <= size; j++)
{
for(int i=1; i <= j; i++)
{
print("* ");
}
println();
}

- Divya k July 03, 2018 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

for(int i=0; i<5; i++)
	{
		for(j=0; j<2*i+1; j++)
		{
			System.out.println("*");
		}
		System.out.println();
	}

- Anonymous July 05, 2018 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

//using 2 for loops
public class Pattern1 {
	public static void main(String[] args) {
		int size = 11;	//here you can give the size whatever you want
		for(int i = 1; i <= size; i=i+2) {
			for(int j = 1; j <= i; j++) {
				System.out.print("*");
			}
			System.out.println();
		}
		
	}
}

- Bushan SC July 09, 2018 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

for(var i=0; i < 5; i++) {
  var str = "";
	for(var j=0; j < 2*i + 1; j++) {
      		str += "*";
	}
	console.log(str);
}

- shashi.dokania July 12, 2018 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

public class Test {

public static void main(String[] a) {
for (int i = 0; i < 5; i++) { //here you can replace 5 according your piramid length
for (int j = 0; j <= i; j++) {
System.out.print("*");
}
System.out.println(); //for new Line
}
}
}

- Rajendra Singh July 17, 2018 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

for (int i = 0; i < 5; i++) {
for (int j = 0; j <= i; j++) {
System.out.print("*");
}
System.out.println();
}

- Rajendra Singh July 17, 2018 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

import java.io.*;
import java.util.*;
public class Pattern
{
	public static void main(String args[])
	{	
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int m=1;
		for(int i=0;i<n;i++)
		{
			for(int j=0;j<m;j++)
			{
				System.out.print("*");
			}
			m=m+2;
			System.out.println();
		}
	}
}

- Ravalika July 17, 2018 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

private static void pattern() {
        for (int i = 0; i < 5; i++) {
            for (int j = 0; j < 2 * i + 1; j++) {
                System.out.print("*");

            }
            System.out.println();
        }
    }

- cvishwakarma July 18, 2018 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

public static void main(String[] args) {
		for (int i = 0; i < 5; i++) {
			String str = "";
			for (int j = 0; j < 2 * i + 1; j++) {
				str = str + "*";
			}
			System.out.println(str);
		}

}

- saritha May 07, 2019 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

package test1;

public class Test1 {

	public static void main(String[] args) {
		printSome(1);
	}

	private static int printSome(int input) {

		if (input > 10)
			return 0;

		for (int i = 0; i < input; i++) {
			System.out.print("*");
		}

		System.out.println();
		input += 2;

		return printSome(input);
	}
}

- mannerh1 October 12, 2019 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

package pattern;

public class Pettern {

public static void main(String[] args) {
// TODO Auto-generated method stub
printPattern();
}
private static void printPattern() {
for(int index = 0; index <= 4; index++) {
for(int innerIndex = 0 ; innerIndex < 2*index + 1; innerIndex++ ) {
System.out.print("*");
}
System.out.println("");
}
}
}

- Rangan Roy September 07, 2020 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More