NetApp Interview Question for Software Engineer / Developers






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

cannot allocate an array of constant size 0

- manu October 01, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

I believe you can. It's just a pointer.

- Codah March 25, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

You are right. Arry size should be greater than 0. I got same error on VS.

- keyurpatel80 July 05, 2014 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

It represents a constant pointer. As a member of a frame (header/payload structure), it can used to point to the future extension of the header thus providing backward/forward compatibility for transporting the frame between systems.

- redfabric February 05, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

cannot allocate an array of constant size 0

- manu October 01, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

apparently it's used in the header files, the interviewer didn't give the complete solution.

- ASB October 02, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

To generate a compilation error under certain conditions, e.g., unwanted template instantiation.

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

Strange! I tried to declare int a[0] and compiled this cpp file.
it doesn't give error and I can assign value, it has size of 4 byte.

any explanation?

- Malhar January 25, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

#include<iostream>
using namespace std;

int main(){
int a[0];
cout<<sizeof(a[0]);
return 0;
}

- malhar87 January 25, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

private static void Test1()
{
string[] s1 = new string[0];
Console.WriteLine(s1);
}
private static void Test2()
{
string[] s2 = new string[] { };
Console.WriteLine(s2);
}

both are same

- Anonymous August 21, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

It is used to explicitly force data alignment for the variables declared next. This is used mostly as element in the structure to force alignment and less outside struct/union. Any definition following this a[0] is guaranteed to be aligned on 4-byte address instead of its natural alignment requirement.

- Sreeni September 11, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 2 vote

int a[0]

can be used to describe a variable-length field of a structure. For example, consider:

struct Foo {
    int x;
    int y;
    int a[0];
};

If I want a to be 10 bytes, I could do:

struct Foo *f = malloc(sizeof(struct Foo) + 10);

If I want a to be 20 bytes, I could do:

struct Foo *f = malloc(sizeof(struct Foo) + 20);

- Garibaldi January 31, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Yes that's correct
you can see this in link
gcc.gnu.org/onlinedocs/gcc/Zero-Length.html#Zero-Length

- Anonymous April 03, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

This type of declaration are used in vector implementation, as vector can be made of size zero.

- sonesh November 26, 2012 | 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