In HackerRank Tests, Candidates are provided with the popular and feature-rich draw.io diagramming tool to answer the Diagram type of Questions. draw.io is integrated with Diagram questions in HackerRank Tests. For Candidates, this tool is easy to use and includes a variety of predefined diagram shapes. These can be readily used by them to create UML diagrams, Entity Relationship diagrams, flowcharts, etc.
The following sections provide you with a brief explanation of the draw.io tool's capabilities in HackerRank tests and how Candidates can use them to design their diagrams and flowcharts.
Refer to the draw.io training material site for detailed information about using the tool.
The draw.io shapes and options available in HackerRank Tests
When Candidates view a Diagram type of Question, the integrated draw.io tool editor is displayed. The editor's left pane includes shapes of different categories which can be used to create the diagrams.
Various shape categories available in the left pane:
The left pane lists a variety of shapes under different categories to represent Classes, Entities, Associations, Arrows, Objects, Tables, Rows, etc, in different types of diagrams. Expand a category to view the available shapes.
- To create UML diagrams, expand the UML category in the left pane and use the shapes to represent Classes, Objects, Attributes, Associations, Dependencies, etc.
- For creating Entity relationship diagrams, use the shapes under the Entity-Relation category to represent Tables, Columns, Rows, entities, etc.
Creating diagrams using the draw.io shapes
- In the left pane, select the relevant category and double-click on the required shape to add the shape to the editor. For example, to represent a class with methods, add the shape that defines a class and its methods.
- To add a shape, double-click on the shape, or drag and drop it into the editor.
- In this manner, add all the required shapes to create your diagram.
- In the editor, double-click on a shape to edit and define the name and other properties.
- Similarly, to represent Entity Relationship diagrams with Tables, Rows, and Columns, use the shapes under the Entity-Relation category.
- Double-click on each shape to edit and define the names for Tables, Rows and Columns, data types, and entity names.
According to the requirements, Candidates can use the same steps to add the shapes from other shape categories in the left pane.
Note: The left pane displays only the shape categories which are permitted by the test setter to answer the Diagram Question. For example, if the question requires creating a UML diagram, Candidates might see only the UML category of shapes and options in the diagram editor.
Diagram Formatting Options
The diagram editor includes a Format Panel which displays on the right and provides options to format the text, styles, and arrangement of shapes in the diagram.
To view the Format Panel in the editor, click the option and select Format Panel from the list. In the diagram, double-click on any shape to view the relevant formatting options in the Format Panel. Format the shapes in the diagram using these options as shown below.
Describing the Diagram
Candidates can also explain their diagrams in the Explanation area available below the diagram editor.
After Candidates have created their diagram and added the description of their representation, they must click Submit Answer and Continue to save the diagram. Similar to the other type of questions in the test, Candidates can revisit the diagram question, change the solution and re-submit their answer any number of times within the test time limit.