Qualcomm Interview Question for Software Engineer / Developers






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

One more thing, if you have embedded experience then do a thorough reading on OS concepts. they will try to confuse you to the core. Most of the time u will be knowing the answer but when u answer the question the expect a complete A-to-Z details about that topic...Be prepared for RTOS and basic OS concepts...Its very important

- Vishal August 03, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

this wont copy '\0'

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

This will copy '/0' also...

#include<stdio.h>
void main()
{
char *p,*q;
while((*p++=*q++)!='\0');
}

- kiran June 23, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

It shd return dest
take care like dest shd be replaced and has enough place

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

main()
{
char *p;
char *q,*temp;
p=(char*)malloc(50);
q=(char*)malloc(50);
temp=q;
strcpy(p,"this is string\0");
printf("%s \n",p);
while(*temp++ = *p++);
printf("%s \n",q);
return 0;
}
Output:
this is string
this is string

- Satish January 07, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

main()
{
char *p;
char *q,*temp;
p=(char*)malloc(50);
q=(char*)malloc(50);
temp=q;
strcpy(p,"this is string\0");
printf("%s \n",p);
while(*temp++ = *p++);
printf("%s \n",q);
return 0;
}
Output:
this is string
this is string

- Satish January 07, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

the simplest would be

char *strcpy(char *dst, const char *src)
  {
          char *rettmp = dst; ///return pointer
          ///pointer and len must have being validated prior invoking this function
          while ((*dst++ = *src++) != '\0')
                  /* nothing needs to be done, sometimes compiler optimizations can create problem but most versions of the gcc works fine*/;
          return rettmp;
  }

- redkrzy April 05, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

#include<stdio.h>
void main()
{
char *p,*q;
while((*p++=*q++) && (*q!='\0'));
}

- TopCoder89 November 22, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

what if p -q <strlen(q)?
you overwrite q?

- Charles January 01, 2014 | 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