Facebook Interview Question for SDE1s


Country: United States




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

without use case this is hard to answer out of the blue, a few questions that might help moving it forward:
- How big is the data?
- Is it structured data or a stream (e.g. video, audio)?
- Is it just a configuration issue?
- What do you plan to do with the data once received?
- Does it fit in memory on the requesting server (the one that looks up the data in the cache)? How about, if it handles multiple requests? Does it just send the data to an other machine, server?
- can you break it down into smaller pieces and get those pieces individually (multi get)?
- can you work on parts of the data?
- can you compress the data? (does this make sense)
- maybe the server just streams the data back to client, so, I might help using ip-rewriting and make the cache servers send individual chunks to the client... not sure if memcached can do that...

... maybe you can add a use case and some numbers?

- Chris October 25, 2017 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

Upon storing
Break the value into blocks containing a value and an unique key generated for the following block, or null if no more blocks left. The first block has a regular key
Upon retrieving
Read the first block, store a value block, check the key portion of the block. Retrieve next block by the key, or stop.

- Anton77 November 09, 2017 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Use a hashmap

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

Maybe create a hashed digest of the data and partition the digest into a size that will fit into the memcache. An index of each value can also be kept within memcache or some table to keep track of each value's partition.

- fjetumale October 26, 2017 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

This requires consideration amount of memcache experience to properly answer. Few of my options are

1> Secondary Indexing, Where we let cache to know its existence and once hit, can redirect to where it is located.
2> Serialization, storing raw bit value, and distributing to multiple cache location till it finds end of object.

Both of the above process are generally used depending upon the requirements.

- hprem991 October 27, 2017 | 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