Interview Question for Software Architects


Country: United States
Interview Type: In-Person




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

Their size might not always be the same.
Typically on x86 arch, we have sizeof(pointer) and sizeof(unsigned int) same, but this might not be true always on all machine.

- Varun March 19, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Their size might not always be the same.
Typically on x86 arch, we have sizeof(pointer) and sizeof(unsigned int) same, but this might not be true always on all machine.

- Varun March 19, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Those are types are not the same, and it a mistake to try to place void pointer into unsigned int .if you planning to build a software that need to run on set of platforms or different arch.
for example on LP64 arch the sizeof(void*) will be 8 and sizeof(unsigned int) will be 4
on ILP32 the size will be the same,,,

- baruchz March 20, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 2 vote

LOL. How deluded can one get?

This is an utterly idiotic question. If someone were to ask me this in an interview, I would laugh at their face and walk out.

- Amar Prem March 20, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

First, we all know what is generic implementation is. Probably in C++ we use template.

In plain C and most embedded technologies ,we use void pointer for generic implementation in C which is basically used to type cast to any other type of valid pointer.
So. what if we use unsigned int to do similar kind of generic implementation.

Firstly can it be done ?? Well we have certain API's in Win 32 library which use unsigned int and share the address space to make the generic behavior of API's.

So, typically we can make an API generic by void pointer and unsigned int (As we can see in numeric examples).. So the question here is what causes the developer to prefer one over other and why?

Whats the advantage and disadvantages of one over other ??


NOTE :- Now for those who has given lot of idiotic comments as I can see.. need to understand the question properly.. Hope it will help you guys to open your eyes before puttinf any more stupid comments.. :)

- hprem991 March 20, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

LOL.

- Anonymous March 21, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Looks. Laughs. Leaves.

- Amar Prem. March 21, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

What are you smoking hprem?

- Anonymous March 21, 2013 | Flag
Comment hidden because of low score. Click to expand.
-2
of 2 vote

I think void pointer can be cast to any other type of pointers, like that if you want to implement a stack in c code to store any type of data,
struct stack_s{
int size;
void **table;
int top;
} if you use int* then you can only store int datas, but if you use void* you can store any type of datas.
then take a look at unsigned int, do you think if we balance the size of a vector or other thing will use negative, or a vector's size is negative, so it obviously tells us that unsigned int can represent the size.

- yingsun1228 March 19, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
-2
of 2 vote

Well the question is not abt the void POINTER and int POINTER (there are hell lot of diff in this case).. The question is about void POINTER and unsigned int. Think deeply...

- hprem991 March 19, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 3 votes

A very deep question. A deeply stupid question that is. Especially if targetted towards "Software Architects".

Did you create this hprem?

- Anonymous March 20, 2013 | Flag
Comment hidden because of low score. Click to expand.
-1
of 3 votes

Well.. than U are jst show what is your level of deep understanding on the subject. I guess U need to first understand before wasting your unnecessary effort to put the comments..

Anyways thanks for highlight how Stupid and coward are U to put comment without name..

- hprem991 March 20, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Thanks hprem. given a right answer.

- Shrikant March 25, 2013 | Flag


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