KPIT | Online Assessment | Design a simple professional network like LinkedIn
Anonymous User
703
/* In this exercise we want to design a simple professional network like Linkedin.
 * We have users associated with fisrt name,last name, experience (in years), a set of skills,
 * an entry whether they are male or female, an internal ID and a set of users in 1st degree 
 * network(let's call them as connections).
 * For e.g.
 *  - id : <unique-id>
 *  - firstName: "Stanley"
 *  - lastName:  "Lippman"
 *  - experience: 8
 * 	- skills: { "C++", "Linux", "Java", "ROS"} 	

 * Some Users are known as Engineers, think of polymorphic design in this perspective, 
 * you may push some of the attributes from User class to Engineer as per the design

 * Our ProfessionalNetwork should provide us with the possibility to add and delete users
 * from the network. It should also allow us to search users by name, experience, id or skills. 
 * Eg.:
 *      searchUserByName("Bjarne"); // any match is fine - either first name, last name 
 *      searchUserByMinimumExperience(2); // Minimum 2 years of experience
 *      searchUserBySkills({"C++", "Linux"}); //Returns all users having one or more of these skills 
 * Additionally we want to retrieve all the users in the 1st degree network 
 * of the user(Connections), getConnectionsOfUser(...)
 *
 * Neither the names of the users have to be unique (e.g. we can have multiple people with First 
 * name as Scott or last name as Meyers in the network)  nor any other attribute.
 * Only the id of every user has to be unique in the whole network.
 * Return actual instances in search functions, all occurences for non unique attributes
 * 
 * The skeleton code below can be used as a starting point but doesn't have to.
 * The comments "fill in" are placeholders where you definitely have to put in some code when 
 * you use this skeleton code. But this doesn't mean that you shouldn't or can't put code anywhere else.
 *
 * Also write some simple unit tests to show how you would test the functionality of the Network.
 * Don't use any testing framework. Simple if-statements are sufficient for this exercise.
 *
 * Hint: Think about performance versus memory tradeoffs in your design, so you can give good 
 *       reasons for your decision, Also a clean code with polymorphic design is important.
 */

class User
{
	/*fill in*/
};

class Engineer /* fill in */
{
    /*fill in*/
};
 
class ProfessionalNetwork
{
public:
	void addUser(/*fill in*/);
	void deleteUser(/*fill in*/);
    /*fill in*/ display(/*fill in*/);
	/*fill in*/ searchUserByName(/*fill in*/);
	/*fill in*/ findUsersByMinimumExperience(/*fill in*/);
	/*fill in*/ searchUserBySkills(/*fill in*/);
	/*fill in*/ getConnectionsOfUser(/*fill in*/);
	
private:
	/*fill in*/
    /*consider suitable container(s) for the collection of users*/
};
Comments (1)