Samsung Interview Question for Software Engineer / Developers


Country: India
Interview Type: In-Person




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

struct ipheader {
unsigned char ip_hl:4, ip_v:4;
unsigned char ip_tos;
unsigned short int ip_len;
unsigned short int ip_id;
unsigned short int ip_off;
unsigned char ip_ttl;
unsigned char ip_p;
unsigned short int ip_sum;
unsigned int ip_src;
unsigned int ip_dst;
}; /* total ip header length: 20 bytes (=160 bits) */

struct tcpheader {
unsigned short int th_sport;
unsigned short int th_dport;
unsigned int th_seq;
unsigned int th_ack;
unsigned char th_x2:4, th_off:4;
unsigned char th_flags;
unsigned short int th_win;
unsigned short int th_sum;
unsigned short int th_urp;
}; /* total tcp header length: 20 bytes (=160 bits) */

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

yep man..this is what i gave him as answer.
He was happy with this :)

- Varun November 22, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

unsigned char ip_hl:4, ip_v:4
what are these Collen meant for? please tell...

- Anonymus July 06, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

it means that ip_hl will occupy 4 bits in memory .

- Shobhit July 06, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

IP Header: h t t p://lxr.linux.no/linux+v3.1.2/include/linux/ip.h#L85
TCP Header: h t t p://lxr.linux.no/linux+v3.1.2/include/linux/tcp.h#L24

- Laxmi Narsimha Rao Oruganti November 22, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

thxn dude, this is what i was looking forward to.

- Varun November 22, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Hey Guys,
What about options field in IP header? IP header length can be from 20 bytes to 60 bytes... (that is why 4 bit varying header length field .)

- anbarasans85 January 05, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

The main thing is to define the data and option fields coz they could be of any size. Can any body tell me how to handle those two fields?????????

- Akkk October 01, 2012 | 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