Qualcomm Interview Question for Software Engineer / Developers






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

www dot cplusplus dot com/forum/articles/9/

This is the best description

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

Array name is a poiter constant so you can't do a=b; if a is array.

char *const
vs
const * char

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

Array is a pointer to const by default
Say : char a[10]; is considered as const char *. so we can not change a pointer a to any other array or pointer but we can point multiple pointers to this array.

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

you are wrong , actually array is "const pointer".

you can not do like:
char arr[]="rahul" ;
arr="gaurav" ; //as the array is const pointer so we can't //change it to dyanamically point to another string

- gaurav October 11, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

const int * B ----> means contents pointed by B is constant....the pointer B can point to any address....

int const * B ----> means pointer B is const i.e its address is constant but u can change the contents stored in that address....

- const April 25, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

int const * B is same as const int * B

it shud be,
int * const B ----> means pointer B is const i.e its address is constant but u can change the contents stored in that address....

- Anonymous May 01, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

From the website: c-faq dot com/aryptr/practdiff dot html

An array is a single, preallocated chunk of contiguous elements (all of the same type), fixed in size and location. A pointer is a reference to any data element (of a particular type) anywhere. A pointer must be assigned to point to space allocated elsewhere, but it can be reassigned (and the space, if derived from malloc, can be resized) at any time. A pointer can point to an array, and can simulate (along with malloc) a dynamically allocated array, but a pointer is a much more general data structure (see also question 4.1).

- jon July 04, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Array is allocated in stack where pointer uses have heap memory ?

- Moorthi August 09, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Array is a collection of similar type of data items and each item is called element of an array.

each element will share the same variable name but have different index.

eg:
int age[50];
float sal[20];


pointer is a variable that stores the memory address.Its called as pointer because it points to a particular address in memory by storing that address.

int *ptr;
int age=30;
ptr=&age;

- prashanthi.07 September 17, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

No, dynamic array also uses heap memory.

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

Difference bw array and pointer is :

**Compiler allocate resource for array at compile time but compiler allocate resource for pointer at execution time.

** Array is a group of element but pointer point to the memory location of variable.

** Pointer are dynamic nature once memory are initialized it can be free or re-sized but for array once memory initialized it can not be free or re-sized.

- Gaurav Kumar Garg December 19, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

array is a char* const, it means that it can be pointed to other memory location but you can change the content of this array
a pointed is a const* char so it means that the content that is pointed by this pointer can not be changed. But you can point this pointer to other places.

- Anonymous March 11, 2011 | 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