التخطي إلى المحتوى الرئيسي

Front-end Interview Question and Answer , Web developer interview question and Answer

 Front-end Interview Question and Answer , Web developer interview question and Answer:


Q: How to explain yourself during an interview?

 Short Syntax and Answers

 A: Describe your background, skills, experiences, and why you are suitable for the job. Highlight key achievements and

 how they relate to the position.

 Q: What is HTML?

 A: HTML (HyperText Markup Language) is the standard language for creating web pages and web applications.

 Q: What is DOCTYPE?

 A: DOCTYPE is an instruction to the web browser about the version of HTML the page is written in.

 Q: HTML 4 and HTML5 differences?

 A: HTML5 includes new elements (e.g., <article>, <section>), audio and video support, and improved form controls

 compared to HTML4.

 Q: div and span difference?

 A: <div> is a block-level element, while <span> is an inline element.

 Q: Semantic tags in HTML5?

 A: Examples include <article>, <section>, <nav>, <header>, and <footer>.

 Q: Form elements tags in HTML5?

 A: New form elements include <datalist>, <output>, <progress>, <meter>, <keygen>, and <input type='date>.

 Q: meta tag in HTML5?

 A: Provides metadata about the HTML document, such as charset, viewport settings, and keywords.

 Q: title tag in HTML?

 A: Defines the title of the document, shown in the browser's title bar or tab.

 Q: Head and body content?

 A: The <head> contains metadata, links to stylesheets, and scripts; the <body> contains the actual content of the

 webpage.

 Q: Favicon?

 A: A small icon displayed in the browser tab, usually linked in the <head> with <link rel='icon'>.

Q: Structured HTML?

 A: Organized and well-nested HTML that improves readability and maintainability.

 Q: alt attribute in image?

 A: Provides alternative text for an image if it cannot be displayed.

 Q: h1 to h6 font sizes?

 A: Font sizes typically decrease from <h1> (largest) to <h6> (smallest), with default sizes being browser-dependent.

 Q: What is CSS?

 A: CSS (Cascading Style Sheets) is a style sheet language used to describe the presentation of HTML documents.

 Q: Difference between HTML & CSS?

 A: HTML structures content, while CSS styles it.

 Q: CSS properties: absolute, relative, fixed?

 A: Absolute: positioned relative to the nearest positioned ancestor. Relative: positioned relative to its normal position.

 Fixed: positioned relative to the viewport.

 Q: display: inline-block, display: block?

 A: Inline-block: elements are inline but respect width and height. Block: elements take up the full width available.

 Q: Overlay in CSS?

 A: A layer that sits on top of another element, often created using position: absolute or position: fixed with appropriate

 z-index.

 Q: !important in CSS?

 A: Overrides other styles regardless of specificity.

 Q: Internal CSS and external CSS?

 A: Internal CSS is within a <style> tag in the HTML file; external CSS is in a separate .css file linked with <link>.

 Q: Bootstrap and its version?

 A: Bootstrap is a front-end framework for developing responsive websites. The latest version as of now is Bootstrap 5.

 Q: Grid in Bootstrap?

 A: A system for creating layouts using rows and columns, responsive across different screen sizes.

Q: What is JS?

 A: JavaScript (JS) is a programming language used to create interactive effects within web browsers.

 Q: What is DOM?

 A: The Document Object Model (DOM) is a programming interface for web documents, representing the structure as a

 tree of objects.

 Q: Virtual DOM?

 A: A lightweight copy of the DOM used to optimize updates and improve performance in frameworks like React.

 Q: Browser Object Model?

 A: Represents browser window components and allows interaction with the browser (e.g., window, navigator).

 Q: HTML element to JS access?

 A: Use methods like getElementById, querySelector, or getElementsByClassName.

 Q: Event in JS?

 A: An action or occurrence detected by JavaScript, such as clicks or key presses, that can trigger a response.

 Q: Array in JS?

 A: A collection of elements stored in a single variable, accessible by index.

 Q: Object in JS?

 A: A collection of key-value pairs, where keys are strings and values can be any data type.

 Q: Map in JS?

 A: A collection of key-value pairs, where keys can be any data type and values are mapped to these keys.

 Q: Loop in JS?

 A: Structures for repeated execution of code, such as for, while, and do...while loops.

 Q: for, for...in, forEach in JS?

 A: for loops iterate over indices, for...in loops over object properties, forEach iterates over array elements.

 Q: Promise in JS?

 A: An object representing the eventual completion (or failure) of an asynchronous operation and its resulting value.

 Q: Blocking and unblocking in JS?

A: Blocking operations stop further execution until complete; non-blocking (asynchronous) operations allow other tasks

 to run concurrently.

 Q: Async & Await in JS?

 A: Keywords for handling asynchronous operations more easily, allowing asynchronous code to be written like

 synchronous code.

 Q: What is TypeScript?

 A: A superset of JavaScript that adds static types and other features to enhance development.

 Q: let, var & const in JS?

 A: let and const are block-scoped, while var is function-scoped. const defines constants.

 Q: Callback function in JS?

 A: A function passed as an argument to another function, to be executed after the first function completes.

 Q: Palindrome string in JS?

 A: A string that reads the same forwards and backwards. Check using string reversal and comparison.

 Q: String reverse in JS?

 A: Reverse a string by splitting it into an array, reversing the array, and joining it back into a string.

 Q: Array max in JS?

 A: Find the maximum value in an array using Math.max with the spread operator.

 Q: Combine two arrays in JS?

 A: Combine using the concat method or the spread operator.

 Q: Split paragraph into sentences in JS?

 A: Use the split method with a period (or other sentence-ending punctuation) as the delimiter.

 Q: Maximum word in paragraph in JS?

 A: Split the paragraph into words, then use a frequency count to find the word with the maximum occurrences


download pdf from here



تعليقات

المشاركات الشائعة من هذه المدونة

Uncontrolled form input in React-JS

  Uncontrolled form input in React-JS? If we want to take input from users without any separate event handling then we can uncontrolled the data binding technique. The uncontrolled input is similar to the traditional HTML form inputs. The DOM itself handles the form data. Here, the HTML elements maintain their own state that will be updated when the input value changes. To write an uncontrolled component, you need to use a ref to get form values from the DOM. In other words, there is no need to write an event handler for every state update. You can use a ref to access the input field value of the form from the DOM. Example of Uncontrolled Form Input:- import React from "react" ; export class Info extends React . Component {     constructor ( props )     {         super ( props );         this . fun = this . fun . bind ( this ); //event method binding         this . input = React . createRef ();...

JSP Page design using Internal CSS

  JSP is used to design the user interface of an application, CSS is used to provide set of properties. Jsp provide proper page template to create user interface of dynamic web application. We can write CSS using three different ways 1)  inline CSS:-   we will write CSS tag under HTML elements <div style="width:200px; height:100px; background-color:green;"></div> 2)  Internal CSS:-  we will write CSS under <style> block. <style type="text/css"> #abc { width:200px;  height:100px;  background-color:green; } </style> <div id="abc"></div> 3) External CSS:-  we will write CSS to create a separate file and link it into HTML Web pages. create a separate file and named it style.css #abc { width:200px;  height:100px;  background-color:green; } go into Jsp page and link style.css <link href="style.css"  type="text/css" rel="stylesheet"   /> <div id="abc"> </div> Exam...

JDBC using JSP and Servlet

JDBC means Java Database Connectivity ,It is intermediates from Application to database. JDBC has different type of divers and provides to communicate from database server. JDBC contain four different type of approach to communicate with Database Type 1:- JDBC-ODBC Driver Type2:- JDBC Vendor specific Type3 :- JDBC Network Specific Type4:- JDBC Client-Server based Driver  or JAVA thin driver:- Mostly we prefer Type 4 type of Driver to communicate with database server. Step for JDBC:- 1  Create Database using MYSQL ,ORACLE ,MS-SQL or any other database 2   Create Table using database server 3   Create Form according to database table 4  Submit Form and get form data into servlet 5  write JDBC Code:-     5.1)   import package    import java.sql.*     5.2)  Add JDBC Driver according to database ide tools     5.3)  call driver in program         ...