Microsoft Interview Question for Software Engineer / Developers






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

I'd better not try Microsoft

- karate August 11, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Hire me and I will give you estimates right from understanding to production dates. :D
stupid interviewer and stupid question.

- hatethisone August 14, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

My guess is this was part of the phone/email screen and the candidate was given enough time to code this up. I say this mostly because of the line: "Pls include a paragraph of how you will test this" and the fact the we seem to have a complete writeup from the original poster in which the question makes sense!

btw, it looks intimidating, but it actually isn't. You only have to implement one method. Try it.

I don't agree with hatethisone. I think this is a nice question. You are actually being tested on how you will be writing real code, not just some handwaving pseudo code.

- LOLer August 14, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

testing. please don't mind

- testing August 18, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Looks like someone's homework assignment to me.

- Anonymous November 06, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Hi All,

the solution can be::::::


HRESULT ProcessData(PBYTE pDataBuffer, IN ULONG cbBufferSize)//



typedef struct tag_HEADER
{
ULONG cbTotalPacketLen;
ULONG cbThisChunkLen;
#define FLAG_FIRST_CHUNK_IN_PACKET 1
#define FLAG_LAST_CHUNK_IN_PACKET 2
ULONG flags;
} CHUNK_HEADER;



HRESULT ProcessData(PBYTE pDataBuffer, IN ULONG cbBufferSize) {

CHUNK_HEADER *header = (CHUNK_HEADER *) malloc(sizeof(CHUNK_HEADER));
static PBYTE *packet;
static int length;
header = (CHUNK_HEADER *)pDataBuffer;

if (header->flags == FLAG_FIRST_CHUNK_IN_PACKET) {
packet = NULL;
packet = (char *) malloc(header->cbTotalPacketLen);
length = header->cbThisChunkLen;
}

elseif(header->flags == FLAG_LAST_CHUNK_IN_PACKET) {
memcpy(packet+length, pDataBuffer+sizeof(CHUNK_HEADER), header->cbThisChunkLen);
ProcessPacket(packet);
packet = NULL;
length = 0;


}
else {

memcpy(packet+length, pDataBuffer+sizeof(CHUNK_HEADER), header->cbThisChunkLen);
}






}

- saurabhroongta2 November 21, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

IF this is called with only 1 byte from the very beginning, you'll get wrong flag.

- Anonymous May 03, 2010 | 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