Google Interview Question for Software Engineer / Developers






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

it should be queue ( assuming proper packet reordering is at OS level... )

- Anonymous September 19, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

I assume you mean pass from the network interface to the OS, for example, an Ethernet card. Typically the network interface driver allocates and pins memory. Tells the hardware to write into it. Then, with that block of host memory, passes off a pointer, list of pointers, or list of lists of pointers to the OS that indicates packets, fragment, pages (scatter/gathers). That way the CPU never copies the memory so it doesn't need to block on a slow bus or pull into it's cache after it has been DMA'ed.

This pointer structure is routed and usually winds up directly in a queue, or depending on where it was routed is serialized into a queue.

- Anonymous October 16, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

How about a stack....
Since every layer appends its header and extracts when forwarded to the OS..

- DashDash September 18, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 2 vote

Stack.....

- DashDash September 18, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I think depend on type of CPU but default should be queue.

- bushido September 21, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

stack is used

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

not stack ..queue will be used..per connection there will be one queue

- shiva cherukuri November 19, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

in linux it is sk_buff structire , in solaris mbulk_t . u can refer source file include/linux/skbuff.h.

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

The question here is "What data structure would you use to pass 1MB of data to OS from network layer for packet delivering?". The wording "from network layer for packet delivering" is causing confusion.

To pass 1MB of data to OS for packet delivery, it is good to use "struct iovec" along with writev() syscall.

- Sri September 27, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

OS gives ring buffers for delivering data to NIC. (atleast in all OS i know).
Ring buffers is continuous virtual memory where after last location, you reach first location
For details refer Stevens

- Arpit Singh June 21, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

Hashing, as it may reduce the data size :)

- Hashing October 06, 2010 | 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