Facebook Interview Question for Research Scientists


Country: United States




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

Person is linked to Entities. An entity would be another person, page etc. The feature set would be the reference set of an entity by that person. And a reference would be weighted.

class Reference {
	private:
		Entity referrer;
		Entity referred;
		unsigned int weight;
		
		// Responsible for taking actions on Reference
		// example weights of a reference will be re-evaluated
		class ReferenceCallback {
			public:
				void readjust(unsigned int deltaWeight);
		};
	public:
		// Resets callback, and reassigns the weight
		void reset(unsigned int weight);
		// Only reassigns the weight
		void reassign(unsigned int weight);
};

class Entity {
	private:
		string id;
		string name;
		string description;
};

class Person : public Entity {
	public:
		unsigned int age;
		Friends* friends;
};

class Page {
	public:
		
};

// Responsible for cooking references between two entities
class ReferenceFactory {
	public:
		// checks if reference is already there, resets the values
		Reference& addReference(Entity& referrer, Entity& referred);
	private:
		// ReferenceCallback is added to readjust after timeout
		Timer* timer;
};

class Timer {
	public:
		void setTimer(ReferenceCallback& referenceCallback, int action);
};

- Anmol March 01, 2017 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Person is linked to Entities. An entity would be another person, page etc. The feature set would be the reference set of an entity by that person. And a reference would be weighted.

class Reference {
	private:
		Entity referrer;
		Entity referred;
		unsigned int weight;
		
		// Responsible for taking actions on Reference
		// example weights of a reference will be re-evaluated
		class ReferenceCallback {
			public:
				void readjust(unsigned int deltaWeight);
		};
	public:
		// Resets callback, and reassigns the weight
		void reset(unsigned int weight);
		// Only reassigns the weight
		void reassign(unsigned int weight);
};

class Entity {
	private:
		string id;
		string name;
		string description;
};

class Person : public Entity {
	public:
		unsigned int age;
		Friends* friends;
};

class Page {
	public:
		
};

// Responsible for cooking references between two entities
class ReferenceFactory {
	public:
		// checks if reference is already there, resets the values
		Reference& addReference(Entity& referrer, Entity& referred);
	private:
		// ReferenceCallback is added to readjust after timeout
		Timer* timer;
};

class Timer {
	public:
		void setTimer(ReferenceCallback& referenceCallback, int action);
};

- Anmol March 01, 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