Facebook Interview Question for Software Engineer / Developers


Country: United States
Interview Type: In-Person




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

I would say that the Like button is a way to create an edge in the OpenGraph between the user and the liked entity. So in my opinion the question is more like: Design a way to represent such a huge graph with different type of edges (likes, friendships, etc...)

- Claudio October 05, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

OH MY GOOOD that the question?((

my Answer

1. module Core
2. widget Functions of material (like, comments, share, delete for item, all functions for item in one widget)
3. view File, like method
4. controller File, get like method from model subject
5. itemSubject(current material, example Photo User or Wall Action etc.)
6. in modelDbTablesLikes, getLikePaginator
7. in database in table "core_likes" like_id resource_type resource_id poster_type poster_id



I answered correctly? :(

- nosay December 22, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

NO.

- Anonymous December 22, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Told me how correcctly answered???

- nosay December 22, 2012 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

Scenario: like, undo like

Service: post service, like service
When a post is liked, count+1 and store the action.
When a like is undone, count-1 and remove the action.

Storage:
count table
likes count needs to be loaded when loading timeline, so use user_id as consistent hash key so that it is on the same machine as the user's timeline.
no sql row key user_id, column key post_id, value likes

like table
no sql db
row key post_id
column key timestamp+ user_id1, user_id2, ...
value user name

Scale:
read qps = dau 1b x 10 read per day/86400 = 100k
peak = 200k, growth = 400k
like qps = 1b x 1/86400 = 10k
peak = 20k, growth = 40k

cache both tables
1b user_id = 4g

reference
ebaytechblog.com/2012/07/16/cassandra-data-modeling-best-practices-part-1/ 2

- undefined October 09, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Can you provide more details...Design a Button ??

- soni vashisht September 20, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Do you mean, design an class for like button? or Designing like button in XAML?

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

i think it might be something like:

Class FBUserAccount
{
     Like[] likes;
}

Class Like
{
     private String url;
     public void AddTo(FBUserAccount user);
}

- topboy September 21, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

class Button
{
Button() { }

Click(){
cout << "Press Like and your wish will come true!" << endl;
}

}

- Hitman September 20, 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