InterView 1st Round
InterView 1st Round
1. Which attribute is used with the <iframe> tag to enable the loading of content inside an iframe to be deferred until it's in view?
a) defer
b) lazyload
c) loading="lazy"
d) async
2. How can you specify a multi-line text area with a fixed size in HTML?
3. How can you use the download attribute in the <a> tag to prompt the user to download a file instead of opening it?
4. How do you specify the initial value of a form input using HTML?
a) value="default"
b) initial="true"
c) default="value"
d) start-value="true"
5. Which HTML5 element is used to represent a footer section for a document or section?
a) <bottom>
b) <footer>
c) <foot>
d) <end>
CSS
1. How does the z-index property work in CSS?
a) To add content before or after an element’s content without modifying the HTML.
b) To hide the element before or after its content.
c) To create responsive layouts for mobile devices.
d) To duplicate the element’s content.
3. What is the purpose of the box-sizing property in CSS, and how does it affect layout?
a) It determines whether padding is added to the element's width and height calculations.
b) It controls the spacing between elements.
c) It adjusts the position of the element on the page.
d) It changes the element's display type.
a) By using @media queries to adjust grid container properties based on screen size.
b) By using display: grid and setting fixed column and row sizes.
c) By using grid-template-columns with relative units like percentages or fr (fractional units).
d) Both a and c.
5. How would you create a circular border around a square element in CSS?
JAVASCRIPT
1. What is the difference between null and undefined in JavaScript?
a) true
b) false
c) NaN
d) undefined
a) == compares both value and type, while === compares only value.
b) == compares only value, while === compares both value and type.
c) == is used for primitive values, and === for objects.
d) == is for strict comparison, while === is for loose comparison.
a) 1
b) 2
c) 3
d) 4
C#
1. What is the purpose of async and await keywords in C#?
a) async marks a method to run synchronously, while await pauses execution until a task completes.
b) async and await allow asynchronous programming by enabling non-blocking operations.
c) async is used for defining threads, and await is used for synchronization.
d) async is for defining methods that handle exceptions, and await is used for error handling.
a) It ensures that the resources are freed when no longer in use, by automatically calling Dispose().
b) It is used to define an alias for a namespace.
c) It is used to define global variables.
d) It is used to import external libraries for use in the program.
4. What is the output of the following code?
int x = 5;
int y = 10;
Console.WriteLine(x == y ? "Equal" : "Not Equal");
a) Equal
b) Not Equal
c) True
d) False
MS SQL
1. Which of the following is used to prevent a SQL Server from executing a query until the next commit or rollback in a transaction?
a) To allow a query to run while ignoring any locks held by other transactions.
b) To prevent the execution of any query while waiting for locks to be released.
c) To release all locks held by the database.
d) To ensure that no transactions are performed until the locks are cleared.
3. In SQL Server, what is the primary difference between INNER JOIN and OUTER JOIN?
a) INNER JOIN returns only matching rows, while OUTER JOIN returns all rows from both tables.
b) INNER JOIN returns all rows, and OUTER JOIN returns only matching rows.
c) INNER JOIN returns rows from one table, while OUTER JOIN returns rows from both tables.
d) INNER JOIN returns only rows from the left table.
5. What is the difference between HAVING and WHERE clauses in SQL Server?
a) HAVING is used to filter records after grouping, while WHERE filters rows before grouping.
b) HAVING is used to filter records before grouping, while WHERE filters rows after grouping.
c) HAVING can only be used with aggregate functions, while WHERE cannot.
d) HAVING filters rows based on a condition, while WHERE filters rows based on a date range.
Answers
*********** HTML
1. Answer: c) loading="lazy"
Explanation: The loading="lazy" attribute delays the loading of an iframe until it is close to being visible in the viewport, optimizing performance.
2. Answer: a) <textarea rows="4" cols="50">
Explanation: The rows and cols attributes in the <textarea> tag define the visible size of the text area.
3. Answer: a) <a href="file.zip" download="filename.zip">Download</a>
Explanation: The download attribute allows the file to be downloaded instead of opened in the browser, and you can specify the file name.
4. Answer: a) value="default"
Explanation: The value attribute is used to set the initial value of form inputs like text fields or checkboxes.
5. Answer: b) <footer>
Explanation: The <footer> element is used to represent the footer of a document or a section, typically containing metadata, links, or copyright
information.
*********** CSS
1. Answer: b) It is used to control the layering order of positioned elements.
Explanation: z-index works with positioned elements (relative, absolute, fixed, sticky) to control their stacking order along the z-axis.
2. Answer: a) To add content before or after an element’s content without modifying the HTML.
Explanation: ::before and ::after allow you to insert content before or after an element's original content, often used for adding decorative elements.
3. Answer: a) It determines whether padding is added to the element's width and height calculations.
Explanation: The box-sizing property can be set to content-box (default, padding and border are not included in width/height) or border-box
(padding and border are included).
4. Answer: d) Both a and c.
Explanation: CSS Grid is responsive by default, and can be combined with @media queries for adjusting grid properties based on screen size,
while fr and percentages allow flexible column/row sizes.
5. Answer: a) Set border-radius: 50% on a square element.
Explanation: A border-radius of 50% on a square element makes it appear as a circle, creating a circular border effect.
************** JS
1. Answer: b) null is a special value representing "no value", and undefined means a variable is declared but not assigned a value.
Explanation: null is a deliberate assignment indicating "no value", while undefined indicates that a variable is declared but hasn't been assigned a
value.
2. Answer: b) false
Explanation: Due to floating-point precision errors in JavaScript, 0.1 + 0.2 does not exactly equal 0.3. The result is 0.30000000000000004, so the
comparison returns false.
3. Answer: c) It refers to the object that calls the function.
Explanation: The value of this is determined by how a function is called, i.e., the context in which it is invoked.
4. Answer: b) == compares only value, while === compares both value and type.
Explanation: == performs type coercion, while === checks for both value and type equality, without type conversion.
5. Answer: d) 4
Explanation: Arrays are reference types in JavaScript, so when b is assigned to a, they both refer to the same object in memory. Changing b[0] also
changes a[0].
*************** C#
1. Answer: b) async and await allow asynchronous programming by enabling non-blocking operations.
Explanation: async is used to define an asynchronous method, and await pauses the execution of the method until the awaited task completes.
2. Answer: b) It prevents a class from being inherited.
Explanation: The sealed keyword is used to prevent a class from being inherited, meaning no other class can derive from a sealed class.
3. Answer: a) It ensures that the resources are freed when no longer in use, by automatically calling Dispose().
Explanation: The using statement is used to manage resources, such as file streams or database connections, and automatically calls Dispose()
when the resource is no longer needed.
4. Answer: b) Not Equal
Explanation: The ternary conditional operator checks if x is equal to y. Since x is 5 and y is 10, the output is "Not Equal".
5. Answer: b) StringBuilder is used for modifying strings, and String is used for creating constant strings.
Explanation: String is immutable, meaning any modification creates a new string, whereas StringBuilder is mutable and designed for efficient string
manipulation, especially in loops.
************** MS - SQL
1. Answer: a) SET TRANSACTION ISOLATION LEVEL
Explanation: SET TRANSACTION ISOLATION LEVEL is used to define the isolation level, which controls how transaction integrity is visible to
other transactions.
2. Answer: a) To allow a query to run while ignoring any locks held by other transactions.
Explanation: WITH (NOLOCK) allows a query to read data without waiting for locks to be released, but it can lead to reading uncommitted (dirty)
data.
3. Answer: a) INNER JOIN returns only matching rows, while OUTER JOIN returns all rows from both tables.
Explanation: INNER JOIN only returns rows where there is a match in both tables, while OUTER JOIN returns all rows from one table and the
matched rows from the other table (or NULL if no match exists).
4. Answer: a) To group rows in a table based on specified columns.
*Explanation: The GROUP BY clause groups rows that have the same values into summary rows, often used with aggregate functions like
COUNT(), SUM(), or AVG(). *
5. Answer: a) HAVING is used to filter records after grouping, while WHERE filters rows before grouping.
Explanation: The WHERE clause filters records before any grouping is performed, while HAVING filters records after grouping, often used with
aggregate functions.