InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Escape Characters |
|
Answer» We can use a backslash(\) to escape literal characters. Before escaping they will look like, * Asterisk\ Backslash ` Backtick {} Curly braces . Dot ! Exclamation mark # Hash symbol - Hyphen symbol () Parentheses + Plus symbol [] Square brackets _ Underscore Output: This is the output that will be shown, if we just type the special characters directly, without using their escape sequences, we get the below output: After escaping by using the \ symbol as: \* Asterisk\\ Backslash \` Backtick \{} Curly braces \. Dot \! Exclamation mark \# Hash symbol \- Hyphen symbol \() Parentheses \+ Plus symbol \[] Square brackets \_ Underscore Output: This is the output that will be shown if we type the special characters along with their escape sequences. Conclusion:From the above cheat sheet, we can observe that using markdown we can format even a simple text document into rich, highly engaging content. Markdown is used in a lot of domains including ed-tech and education fields to create highly engaging and high-quality content for the consumers at a fast pace. With its rich list of available features, it can be used innovatively in a wide variety of ways and purposes. Additional Useful Resources:
|
|
| 2. |
Horizontal Rule |
Answer»
*** ___ Output: |
|
| 3. |
Lists |
|
Answer» There are 2 types of lists we can add in markdown, 1. Ordered Lists:
2. Element 2 3. Element 3 Output:
1. Level 2 - Level 3 - Level 4 2. Level 1 1. Level 2 3. Level 1 1. Level 2 Output:
2. Unordered Lists: We can create unordered lists with an asterisk(*), (+), or (-) signs as shown below:
* Element 2 * Element 3 Output:
+ Element 2 + Element 3 Output:
- Element 2 - Element 3 Output:
3. Nested Unordered Lists: Unordered Lists can also be nested into multiple sublists beneath them similar to ordered lists. The example below shows how to implement nested unordered lists in markdown. Syntax: - Level 1- Level 2 - Level 3 - Level 4 - Level 1 - Level 2 - Level 1 - Level 2 Output:
We can create lists in the following way by using the HTML tags as shown below:
<li>First item</li> <li>Second item</li> <li>Third item</li> <li>Fourth item</li> </ol> Output:
<li>First item</li> <li>Second item</li> <li>Third item</li> <li>Fourth item</li> </ul> Output:
We can also create task lists in markdown using a hyphen(-) followed by [ ] braces. An x is put inside the braces to indicate the task is complete. Example: - [x] Buy Eggs.- [ ] Buy Milk. - [ ] Wash Clothes. Buy Eggs Buy Milk Buy Books |
|
| 4. |
Images and GIFs |
|
Answer» Images can also be added in markdown using methods similar to what we used for adding links.
Output:
[image]: https://d3n0h9tb65y8q.cloudfront.net/public_assets/assets/000/002/561/original/Reference_Style.png?1642758170 Output:
Output:
Output: |
|
| 5. |
Links |
|
Answer» There are 4 ways of creating a link in markdown:
Output: Link1
[reference text]: https://www.interviewbit.com/practice/ Output: Link1
Output: A relative link
Output: Visit https://www.interviewbit.com/practice/ |
|
| 6. |
Markdown Tables |
|||||||||||||||||||||||||||||
Answer»
<tr> <td> First Entry </td> <td> Second Entry </td> <td> Third Entry </td> </tr> </table> Output:
In the example, the text in the columns will get aligned to the side where we put the : symbol. If the : is put on both sides, the text will be centre aligned. No alignment appears the same as left align. | No Align | Right Align | Left Align | Center Align || -------- | -----------:|:---------- |:------------:| | 1 | 1 | 1 | 1 | | 11 | 11 | 11 | 11 | | 111 | 111 | 111 | 111 | | 1111 | 1111 | 1111 | 1111 | Output:
In this example, the use of the <br> tag is shown to build a table with multiple lines in a column. | Column 1 | Column 2 | Column 3 ||:--------:|:--------:|:---------------:| | A | B | C <br> D <br> E | Output:
|
||||||||||||||||||||||||||||||
| 7. |
Syntax Highlighting |
|
Answer» We can highlight code syntaxes using markdown by using a backtick(``) symbol before and after the code block. For multiline code formatting, we can also use 3 backticks for the purpose as illustrated in the example below.
This is an example of a `code` block. Output: This is an example of a code block.
``` Output: This is an example of multiline code block. Code Highlighting:
``` cout << x << endl; Code Highlighting with Language specified:
```C++ cout << x << endl; |
|
| 8. |
Text Styles |
|
|
Answer» We can use markdown to change the styles of selected text to different styles like bold, italics, blockquotes, underline, strike-through, etc.
*Hello* Method 2: <em>Hello</em> Output: Hello Hello
*Hello* Method 2: <em>Hello</em> Output: Hello Hello
>> Nested blockquotes. >>> More nesting. Output: This is a blockquote.Nested blockquotes.More nesting.
Output: This is an underlined text
Output: The text is struck
Output:
Superscript <sup>Example.</sup> Output: Subscript Example. Superscript Example. |
||
| 9. |
Markdown Headings |
|
Answer» Headings tell us about the title or subject of a piece of work. In markdown, there are 2 main ways to write headings both of which are discussed below:
We can write headings in markdown using the # symbol, followed by the heading that we want to write. The number of ‘#’ symbols indicate the size of the header. More the number of ‘#’ symbols, smaller the font size of the header. There are a total of 6 types of headers available in markdown. Example: # Heading1## Heading2 ### Heading3 #### Heading4 ##### Heading5 ###### Heading6 Output: Heading 1 Heading 2 Heading 3 Heading 4 Heading 5 Heading 6
We can also write headers using HTML formats using <hi></hi> (where i varies from 1 to 6, and it represents the size of the headers, from large to small) tags. Example: <h1>Heading 1</h1><h2>Heading 2</h2> <h3>Heading 3</h3> <h4>Heading 4</h4> <h5>Heading 5</h5> <h6>Heading 6</h6> Output: Heading 1 Heading 2 Heading 3 Heading 4 Heading 5 Heading 6 |
|
| 10. |
Markdown Files |
|
Answer» A text file created with several syntaxes of a Markdown language is called a Markdown File. It makes use of plain text formatting consisting of inline text symbols for specifying how a text can be formatted. How to open a markdown file offline? Markdown files are of the extension "*.md" where * represents the file name. They can be opened offline using certain Chrome plugins like the “Markdown Preview Plus”. Visual Studio Code by Microsoft also allows the user to toggle between Markdown code and its preview. Or you can simply open it using Notepad/Notepad++ or WordPad software. Online Markdown Editors: There are many online Markdown editors in the market currently, which have soared in popularity due to their easy use case and a wide variety of features available. Some of the most popular ones are HackMD and StackEdit, which provide many features along with basic markdown, to render richly formatted content. Advantages of Markdown Files: Some of the advantages of Markdown are stated below:
|
|