Adobe Interview Question for Software Engineer / Developers






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

A good explanation here
campuscoke.blogspot.in/2014/12/allocate-two-dimensional-array-using.html

- Jack December 30, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

int (*p)[rows],i,j;
p=(int (*)[rows])malloc(rows*cols*sizeof(int));
Now you can access p using the normal array subscipt notation(p[i][j] etc) ..

- psp.reachable@gmail.com October 04, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

//size of a pointer and int variables are same
int **a = (int**)malloc(rows + sizeof(int) * (rows*columns));
int i, j;
for(i=0;i<rows;i++)
{
a[i] = &(**a) + rows + rows*columans;
}

so only one call to malloc is suffucient

- mail2vcp@gmail.com September 29, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I am not able to access the array as a[i][j]...
can u clarify please

- Prashasti November 05, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

void** my2DAlloc(size_t Rows, size_t BytesInRow)
{
void **a = (void**)malloc(Rows*BytesInRow);
int i;
for(i=1; i<Rows; i++)
a[i] = (char *)a[i-1] + BytesInRow;
return a;
}

- Ada March 26, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

template<class T>
T ** func(int m, int n)
{
T **ptr = new T * [m];
ptr[0] = new T[m * n];
for(int i = 1 ; i < m ; i ++)
{
ptr[i] = ptr[0] + i * n;
}
return ptr;
}

- Atleast 2 loops needed May 15, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

template<class T>
T ** func(int m, int n)
{
   T **ptr = new T * [m];
   ptr[0] = new T[m * n];
   for(int i = 1 ; i < m ; i ++)
   {
       ptr[i] = ptr[0] + i * n;
   }
   return ptr;
}

- Atleast 2 loops needed May 15, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

1. int **array1 = malloc(nrows * sizeof(int *));
for(i = 0; i < nrows; i++)
array1[i] = malloc(ncolumns * sizeof(int));

2. int (*array2)[NCOLUMNS] = malloc(nrows * sizeof(*array2));
3. int (*array3)[NROWS][NCOLUMNS] = malloc(sizeof(*array3));

- Joe November 26, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

// Access elements as myarray[i][j]
void Alloc2D(int no_of_rows, int no_of_columns)
{
int **myarray = (int **)malloc(no_of_rows * sizeof(int *));
for(int i = 0; i < no_of_rows; i++)
{
myarray[i] = (int *)malloc(no_of_columns * sizeof(int));
}
}





//Method2 (keep the array's contents contiguous)
// Access elements as myarray[i][j]
void Alloc2D_2(int no_of_rows, int no_of_columns)
{
int **myarray = (int **)malloc(no_of_rows * sizeof(int *));
myarray[0] = (int *)malloc(no_of_rows * no_of_columns * sizeof(int));

for(int i = 1; i < no_of_rows; i++)
myarray[i] = myarray[0] + (i * no_of_columns);


}

- M August 22, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

'

- Anonymous February 03, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

and 1=

- Anonymous February 03, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

' and 1=

- Anonymous February 03, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

\'

- Anonymous February 03, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

'''

- Anonymous February 03, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

ookjk85h74

- Anonymous February 03, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

1 OR 1=1

- Anonymous February 03, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

1' OR '1'='1

- Anonymous February 03, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

1'1

- Anonymous February 03, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

' 1 AND 1=1

- Anonymous February 03, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

1 AND 1=1

- Anonymous February 03, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

1\'1

- Anonymous February 03, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

) or ('1'='1--

- Anonymous February 03, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

' or 1=1/*

- Anonymous February 03, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

' or 1=1--

- Anonymous February 03, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

order by 1000/*

- Anonymous February 03, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

order by 1000;--

- Anonymous February 03, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

' order by 1000/*

- Anonymous February 03, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

' order by 1000;--

- Anonymous February 03, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

' or 1=1--

- Anonymous February 03, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

" or 1=1--

- Anonymous February 03, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

') or ('a'='a

- Anonymous February 03, 2013 | 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