Bloomberg LP Interview Question for Software Engineer / Developers






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

Same question was asked in paypal quiz. Did it well. O(n)

- Pratik March 23, 2006 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

I was asked onsite (lex. av. 731) to write a function to remove the spaces from a string inplace, here is what I wrote, they enjoyed that

void remspaces(char *s)
{
int i, j = 0;

for (i = 0; s[i]; i++)
{
if (isspace(s[i]))
continue;

s[j++] = s[i];
}

s[j] = 0;
}

- knakov April 12, 2007 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

/*write a function to remove the spaces from a string inplace,*/
#include<stdio.h>
void main()
{
char s[50];
char *p;
int temp = 0;
int i=0;
printf("Please Enter a string ");
p = gets(s);

while(p[i]!='\0')
{
//printf("In Loop");
if(p[i]!=' ')
{
s[temp++] = p[i++];
continue;
}
else
{
//temp = i;
while(p[i] == ' ')
i++;
s[temp++] = p[i];
}
i++;
}
s[temp] = '\0';
printf("The final string is %s \n", s);
}

- gauravk.18 December 08, 2007 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Use single link

- rp May 20, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

void removeSpace()
{
char s1[100];
char* ptr1 = s1;
char* ptr2 = s1;

strcpy(s1, "h 1");

if(s1 == NULL || *s1 == '\0')
return;

while(*ptr1)
{
if(*ptr1 != ' ')
*ptr2++ = *ptr1++;
else
ptr1++;
}
*ptr2 = '\0';

printf("\nString: %s\n" , s1);
}

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

void removeSpace()
{
char s1[100];
char* ptr1 = s1;
char* ptr2 = s1;

strcpy(s1, "h 1");

if(s1 == NULL || *s1 == '\0')
return;

while(*ptr1)
{
if(*ptr1 != ' ')
*ptr2++ = *ptr1++;
else
ptr1++;
}
*ptr2 = '\0';

printf("\nString: %s\n" , s1);
}

- Jester January 18, 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