Facebook Interview Question for Software Engineer / Developers


Country: United States
Interview Type: In-Person




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

I would start by designing this from a top level restfully backed mobile client application.
We would want to break the feature into a common design pattern. This would include Models for the Posts and User. A Network class to manage getting the data for the posts from the facebook API. A Controller (Activity) to NewsfeedActivity. This controller would use the models and views to produce the UI for the newsfeed list view. The Model would interface with the Network Class to get the data and convert it to formats the controller requires. And finally, views for the newsfeed post items, and the list container.

After laying out the general design I would go into implementation details about how the Activity would manage this UI using most likely an ArrayList list adapter.

- android-anon April 15, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

This is a bare minimum logic:

There are users.
User has a list of Posts.
User has a list of friends.
There is a news feed for each user.
News feed has a list of Posts collected from your friends list Using Observer pattern.

- yesudas March 27, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Barry, Did you interview in Palo Alto or Seattle?

- gmelshall April 05, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Menlo Park (near Palo Alto)

- Barry Fruitman April 05, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

barry...can u share ur answer too

- anonymous July 20, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Use MVC where

public class Controller { //User updates will make a call to this class
statusUpdate(String userId, Status status); //makes call to model
postPhoto(String userId, Photo photo);
}

public class Model { //Does db updates and notifies view
statusUpdate(String userId, Status status); //Updates status in DB, finds user and his friends, notifies friends views with new status
postPhoto(String userId, Photo photo);
}

public class View {
String userId;
Wall wall;
updateWall(User user, Status status);
updateWall(User user, Photo photo);

}

- Rocco October 20, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Curious, I like your answers's design. However I find the Controller is actually the activity and the view are the XML layout files ( or NIB files). Where you would have a "ViewController" per view which is actually your Activity in the case of android; or a ViewController in the case of iOS. Therefore the design becomes platform agnostic.

- android-anon April 14, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Create a NewsFeed Activity that uses a List Adapter to populate a ListView with data from a Cursor returned by a request to a Content Provider.

- Jimoh Ovbiagele November 19, 2013 | 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