Adobe Interview Question for Java Developers


Country: India
Interview Type: In-Person




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

In JavaScript, this might be the way

function getMetheOutput(n) {
    var string = '';
    for (var i = 1; i <= n; i++) {
        string += i + '';
        for (var j = 2; j <= i; j++ ) {
            string += '*' + i;
        }
        string += ' + ';
    }
    console.log(string); // alert if you wish
}

- invincible.om July 12, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 4 vote

int summation (int num)
{
int sum = 0;

for (int i = 1; i <= num ; i++)
{
int k = 1;
for(int j = 1 ; j <= i; j++)
{
k *= i;
}
sum += k;
}
return sum;
}

}

- Hunter July 12, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

I think question is not about to find sum, but to print the o/p in the same fashion as given in question:

int n = 10,i,j;
for(i = 1; i <= n; i++)
{
for(j = 1; j <= i; j++)
{
cout<<i;
if(i != j)
cout<<"*";
else if(i != n)
cout<<"+";
}
}

- shani July 12, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 4 vote

import java.io.*;
public class summationprint {
public static void main(String[] args)throws IOException{
	BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
	int ip=Integer.parseInt(br.readLine());
	String s="";
	s+="1"+"+";
	for(int i=2;i<=ip;i++){
		s=s+i+"*";
		for(int j=1;j<i-1;j++){
			s+=i+"*";
		}
		s=s+i+"+";
	}
	String as=s.substring(0,s.length()-1);
	System.out.print(as);
}
}

- faisal.mehfooz July 12, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Since when adobe started asking such questions.

- nerd July 12, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

it was in a 1st round written test

- sarthakiter July 12, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

@sarthakiter plz share more question of adobe written round and interview . I have written test 2morrow .

- ninja July 19, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 2 vote

i think question is to check whether you see overflow here or not. if yes then how to fix that.

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

public class RepeatMe
{
public static void main(String args[])
{
repeatMe(5);
}
public static void repeatMe(int i)
{
StringBuffer sb = new StringBuffer();
int j=1;
while(i>0)
{
sb.append(i);
if(j==i)
{
j=1;
i=i-1;
if(i != 0)
sb.append("+");
}
else
{
j++;
sb.append("*");
}
}
System.out.println(sb.reverse().toString());
}
}

- Raghava July 12, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

void main()
{
int n,i,j,k,sum=0,tempsum=0;
signed int arr[20]={0};
int poweri(int i,int *j);
printf("\n number of inputs need to be entered \n");
scanf("%d",&n);
for(i=n;i>0;i--)
{
j=i;
tempsum=poweri(i,&j);
sum=sum+tempsum;
}
printf("sum is %d",sum);
getch();
}

int poweri(int i,int *k)
{
int j,sumi,l;
j=i;
if(*k==1)
return j;
else
{
*k=*k-1;
l=*k;
sumi=i*poweri(i,&l);
}
}

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

public class Series {
	
	public int calculateSeries(int number)
	{
		if(number==1)
			return 1;
		int multiplier=1;
		for(int i=0;i<number;i++)
		{
			multiplier*=number;
		}
		
		return multiplier+ calculateSeries(number-1);
	}
	public static void main(String[] args) {
		
		Series s= new Series();
		System.out.println(s.calculateSeries(4));
	}

}

- codingAddicted July 21, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

char * PrintInGivenFormat( int n , char *s)
{
int j=0, k=1;
s[j++] = i;
s[j++] = '*';
for( i =1;i<=5;i++)
{
while( k<= (2*i-1))
{
if( K%2 == 1)
{
s[i] = i;
}
else
{
s[i] = '*';
}
}
}
}

- Himanshu chauhan August 29, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

#include<stdio.h>
main()
{ int i,j,n,s=0;
printf("Enter the value of n\n");
scanf("%d",&n);
printf("The output is \n");
for(i=1; i<=n; i++)
{
int k=1;
for(j=1; j<i; j++)
printf("%d*",i);
if(i<n)
printf("%d+",i);
else
printf("%d",i);
}
}

- @123 August 31, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

public class loopNumber {

	public static void main(String[] args) {

		int i = 5;
		String sumStatement = getString(i);
		System.out.println("Output :: " + sumStatement);

	}
	public static String getString(int i) {
		String s = "1";
		if (i == 1)
			return "1";

		for (int k = 2; k <= i; k++) {
			s = s + '+' + getloopString(k);

		}

		return s;

	}

	public static String getloopString(int i)

	{
		String temp = "";
		for (int k = 0; k < i; k++) {
			temp = temp + i + '*';
		}

		return temp.substring(0, temp.length() - 1);

	}

}

- Bikash January 31, 2014 | 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