Are you curious about the questions asked in the full-stack round? Explore the 30 most asked full-stack interview questions for freshers below!
Tech interview rounds for freshers assess programming skills, problem-solving ability, and knowledge of basic algorithms and data structures, often including coding challenges. They may evaluate your understanding of basic concepts, interest in tech trends, and behavioural aspects like communication and teamwork. Preparation includes practising coding problems, reviewing core concepts, and being ready to discuss your projects and experiences.
Q1. What are the basic building blocks of HTML?
Ans. The basic building blocks of HTML are:
<!DOCTYPE html> <html> <head> <title>Basic HTML Example</title> |
Q2. What are some common HTML tags?
Ans: Some common HTML tags are,
Example:
<table> |
‘<form>’, ‘<input>’, ‘<button>’: Constructs forms, input fields, and buttons.
Example:
<form action="/submit" method="post">
<input type="text" name="username">
<button type="submit">Submit</button>
</form>
‘<head>’
,
‘<title>
’,
‘<meta>
’: Provides metadata and title for the document.
Q3. What is the purpose of the href attribute in the tag?
Ans. The href attribute in the tag specifies the destination of a hyperlink. It defines the URL to which the user will be directed when clicking the link.
<!DOCTYPE html> |
<a href="https://example.com">Visit Example Website</a>
Q4. What is the purpose of the <span> tag in HTML?
Ans. The <span> tag in HTML is a generic inline container used to apply styles or manipulate specific parts of text within a larger block of content without adding any semantic meaning.
<!DOCTYPE html> |
The <span> tag is used to highlight a specific word within a paragraph. The class=”highlight” attribute is added to the <span> to apply CSS styles and change the color and weight of the text.
Q5. How many types of headings does an HTML contain?
Ans. HTML includes six heading levels designated by the <h1> to <h6> tags. Each heading tag presents text at a distinct size, with <h1> being the largest and <h6> the smallest. For instance:
Q6. What is a marquee?
Ans: A marquee is an element that creates a scrolling or moving text or image effect within a web page. It’s primarily used for displaying dynamic content that moves horizontally or vertically across the screen.
The ‘<marquee>’ element creates a scrolling effect for the text “This text is scrolling from left to right.” The ‘behavior’ attribute specifies the scrolling behavior (in this case, scrolling), the direction attribute determines the scrolling ‘direction’ (left), and the ‘scrollamount’ attribute sets the scrolling speed.
Q7. What is CSS?
Ans. CSS stands for Cascading Style Sheets. It’s a style sheet language used to describe the presentation of a document written in markup languages like HTML or XML. Essentially, CSS is responsible for how a web page looks, including layout, colors, fonts, and animations. It allows web designers to separate the structure and content of a web page from its visual presentation, making it easier to manage and maintain websites. CSS selects HTML elements and applies styling rules to them, either directly within the HTML document or in an external CSS file.
Syntax:
selector { Property: value; } |
Q8. What are the methods to incorporate CSS into a webpage?
Ans: To include CSS on a web page, you typically use one of these methods:
<p style=”color: blue; font-size: 16px;”>This is a paragraph.</p> |
<head> <style> p { color: blue; font-size: 16px; } </style> </head> |
<head> <link rel=”stylesheet” type=”text/css” href=”styles.css”> </head> |
Q9. Which type of CSS holds the highest priority?
Ans. In CSS, the type of selector with the highest priority is the inline style. Here’s the order of specificity, from highest to lowest:
Q10. How would you select all direct children elements of a particular type?
Ans. To select all direct children of a specific type in CSS, you can use the > child selector combined with the desired element to build the selector.
For example, to select all the direct children that are <li> elements within an <ul> element, you would use the following CSS:
ul > li { |
Q11. What does * { box-sizing: border-box; } do? What are its advantages?
Ans. The CSS rule * { box-sizing: border-box; } applies the box-sizing property with a border-box value to all elements on a web page.
This rule changes the box model used by elements. Normally, when you set the width or height of an element, it only applies to the content area, and padding and borders are added to the specified width or height. With box-sizing: border-box, the width and height specified for an element include padding and borders, making layout calculations more intuitive.
Advantages:
Using box-sizing: border-box; promotes cleaner and more maintainable CSS code, streamlining the development process.
Q12. What is the CSS float property?
Ans. The CSS float property is used to align elements horizontally within their container. When an element is floated, it is removed from the document’s normal flow and positioned to the left or right of its container, allowing other content to wrap around it. This property is commonly used for creating layouts, such as multi-column designs or floating images within text.
.container { } .left { float: left; width: 50%; |
Q13. What is an event in JavaScript?
Ans. In JavaScript, an event refers to an action or occurrence that takes place within the browser or web page. User interactions like clicks, inputs, or page loading trigger web events; they allow developers to create interactive web apps by modifying page elements based on user actions.
Some common types of events in JavaScript include Mouse Events, Keyboard Events, Form Events, Document and Window Events, and Touch Events.
Q14. What is JSON and its common operations?
Ans. JSON is a lightweight data-interchange format that is easy for humans to read and write and for machines to parse and generate. As an alternative to XML, it is commonly used to transmit data between a server and a web application.
JSON is a text-based format that uses key-value pairs. Keys must be strings, while values can be strings, numbers, arrays, objects, booleans, or null. JSON data structures are similar to JavaScript object literals.
Common operations with JSON include:
Q15. What will be the output of the following code?
var a = [1, 2, 3];
var b = [1, 2, 3];
Ans. console.log(a == b); // Output: false;
Arrays in JavaScript are reference types, which means that even if two arrays have the same values, they are not considered equal because they are stored in different memory locations. When comparing two arrays using the abstract equality operator (==), the comparison checks whether both operands refer to the same array object in memory, which is not the case here. So, the output will be false.
Q16. How do we define comments in JavaScript?
Ans. Comments in Javascript define as,
Q17. What is a unary function?
Ans. A unary function is a function that takes exactly one argument. In mathematics and computer science, unary operations or functions are operations or functions that take a single input.
For example, consider the following unary function in JavaScript:
const square = (x) => x * x;
In this function, ‘square’ is unary because it takes only one argument ‘x’.
Unary functions can be found in various contexts, including mathematics, programming, and logic. They are fundamental building blocks in many algorithms and computations.
Q18. How do you decode or encode a URL in JavaScript?
Ans. You can decode or encode a URL using the decodeURIComponent() and encodeURIComponent() functions, respectively.
let url = “https://www.example.com/?q=%C3%A9%20%C3%A0”;
let decodedUrl = decodeURIComponent(url);
console.log(decodedUrl);
// Output: “https://www.example.com/?q=é à”
let url = “https://www.example.com/?q=é à”;
let encodedUrl = encodeURIComponent(url);
console.log(encodedUrl);
// Output: “https%3A%2F%2Fwww.example.com%2F%3Fq%3D%C3%A9%20%C3%A0”
Note: If you wish to encode characters like / ? : @ & = + $ #, you should utilize encodeURIComponent().
Q19. What is ClickJacking?
Ans. Clickjacking is a type of attack that tricks a user into clicking a webpage element which is invisible or disguised as another element.
Q20. Mention the difference between MySQL and MongoDB
Ans. MySQL implements SQL, which is based on table-based databases, while MongoDB implements NoSQL, which is based on BSON (binary encoded JSON) data, which can include tables, objects and other types of data.
Get registered for the Full-Stack interview premium package now!