Question For Interview 2024 Dec. PDF
Document Details
Uploaded by ConstructivePythagoras5183
2024
Tags
Summary
This document contains a collection of questions for an interview, covering topics like HTML, CSS, JavaScript, Node.js, and Angular web development concepts. The questions are likely part of a past paper or practice set for a web development related exam.
Full Transcript
**HTML-13** **1. How do you change the text color in HTML?** - - - - **2. What is the 'class\' attribute in HTML used for?** - - - - **3. How do you display a table on an HTML webpage?** - - - - **4. What is a marquee in HTML?** - - - - **5. What are the...
**HTML-13** **1. How do you change the text color in HTML?** - - - - **2. What is the 'class\' attribute in HTML used for?** - - - - **3. How do you display a table on an HTML webpage?** - - - - **4. What is a marquee in HTML?** - - - - **5. What are the 3 required parts of an HTML document?** - - - - 6. **Which of the following is a correct syntax for using an HTML attribute ?** - - - - 7. **Add a \"placeholder\" to the input textbox below with the text \"Enter your name\".** \ 8. **Add a "tooltip" to the paragraph below with the text "About Tristha"** \ Welcome to Tristha \ 9. **Set the size of the image to 250 pixels wide and 500 pixels tall.** \ 10. **Make the element below into a link that goes to "https://tristhaglobal.com/"** \ Click here \ 11. **What HTML attibute is used to create a bookmark?** - - - 12. **What is the correct name tag name for table-header in HTML.** - - - 13. **The class name is case sensitive.** - - **CSS-10** **1. Which of the following are CSS display properties?** - - - - **2. What does the 'A' in rgba(R, G, B, A) stand for?** - - - - **3. What does margin: 40px 100px 120px 80px; signify?** - - - - **4. How can we format text in CSS?** - - - - **5. How can we hide an element in CSS?** - - - - **6. What is CSS overflow used for?** - - - - 7. **What is a correct syntax for specifying a CSS media query?** - - - - 8. **What is the correct syntax for opening the form's result in new browser tab?** - - - - 9. **Use the border shorthand to set a "4px" , "dotted" , "red" border for the \ elements?.** \ P { \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_\_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_\_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_ \_; } \ 10. **What is the correct syntax for set the background-color to red, when you mouse over a link to the following statement \ Click here\>\** - - - - **JavaScript-10** **1. What are the different data types in JavaScript?** - - - - **2. What is the difference between == and === in JavaScript?** - - - - **3. What is Scope and Scope Chain in JavaScript?** - - - - **4. What are callbacks in JavaScript?** - - - - **5. What is DOM in JavaScript?** - - - - **6. What are async and await in JavaScript?** - - - - **7. What are arrow functions in JavaScript?** - - - - **8. What are the differences between var, let, and const?** - - - - 9. **What is not correct syntax for writing output in Javascript** - - - - 10. **Which one is not a legalize variable name?** - - - - **NodeJs-14** **1. Is Node.js single-threaded?** - - - - **2. What is npm, and what are its advantages?** - - - - **3. What is middleware in Node.js?** - - - - **4. What do you mean by the event loop in Node.js?** - - - - **5. What is package.json in Node.js?** - - - - **6. What are child processes in Node.js?** - - - - **7. What are master and slave clusters in Node.js?** - - - - 8. **Which of the following methods is used to create a server in Node.js?** - - - - 9. **Which of the following is true about asynchronous programming in Node.js?** - - - - 10. **Which of the following middleware functions is used to parse incoming request bodies in a middleware before your handlers?** - - - - 11. **What does the next() function do in Express middleware?** - - - - 12. **Which of the following is NOT a part of a JWT?** - - - - 13. **How can you securely store JWTs on the client side?** - - - - 14. **What library is commonly used for handling JWT in Node.js?** - - - - **Angular-17** **1. What are the main features of Angular?** - - - - **2. What is a component in Angular?** - - - - **3. What is an Angular router?** - - - - **4. How can you pass data between components in Angular?** - - - - **5. What is lazy loading in Angular?** - - - - **6. What are Angular lifecycle hooks?** - - - - **7. What are Angular Guards?** - - - - 8. **What is the purpose of the \@Component decorator in Angular?** - - - - 9. **How do you apply a CSS class conditionally to an element in Angular?** - - - - 10. **You encounter an error stating \"Cannot read property \'x\' of undefined\". What is likely causing this issue?** - - - - 11. **When debugging an Angular application, which tool can you use to inspect HTTP requests made by your application?** - - - - 12. **What does the error \"404 Not Found\" indicate when trying to access an API endpoint in your Angular application?** - - - - 13. **In Angular, how do you bind a property of a DOM element to a component property?** - - - - 14. **Which command would you use to create a new Angular project with SCSS as the stylesheet format?** - - - - 15. **Which command would you use to create a new Angular project with SCSS as the stylesheet format?** - - - - 16. **What does the \@Injectable() decorator do in Angular?** - - - - 17. **Which directive is used to conditionally include a template based on the value of an expression?** - - - - **CT-18** **1. What happens if the following code is executed?** let arr = \[1, 2, 3\]; arr\[5\] = 10; console.log(arr.length); - - - - 2.**What happens if the following code is executed?** function isEven(num) { return num % 2 === 1 ? \"Even\" : \"Odd\"; } console.log(isEven(4)); - - - - 3**.What is the output?** let x = 10; function testScope() { let x = 20; console.log(x); } testScope(); console.log(x); - - - - **4.What is the output of the following code?** for (var i = 0; i \< 3; i++) { setTimeout(() =\> console.log(i), 1000); } - - - - **5.What is the result of this code?** function greet(name) { if (!name) { name = \"Guest\"; } return \`Hello, \${name}!\`; } console.log(greet()); console.log(greet(\"Alice\")); - - - - **6.What is the issue with the following code?** try { throw \"An error occurred\"; } catch (err) { console.log(error); } - - - - 7. **What will be the output of below code.What will be the result of z?** let x=5, y='8'; let z = x + y ; - - - - 8. **What is the data types of the following variables?** a. let x = 7.5 - - - - 9. **What will be the output of following code.** let array = \[ 2,7,8\]; array\[10\] = \[9\]; console.log(array.length); - - - - 10. **Merge two objects into one** const object1 = { a : 1 } ; const object2 = { b: 1 } ; - - - - 11. **What will be the output of the following code?** function test(){ console.log(x); var x = 10; } test(); - - - - 12. **What will be the output of the following code?** let x = 1; If(true){ let x =2 ; console.log( x ); } console.log( x ); - - - - 13. **What will be the output of the following code , and how does the makeCounter() function work?** function makeCounter() { let count = 0; return { increment: function() { count++; return count; }, decrement: function() { count\--; return count; }, getCount: function() { return count; } }; } const counter = makeCounter(); console.log(counter.increment()); // ? console.log(counter.increment()); // ? console.log(counter.getCount()); // ? console.log(counter.decrement()); // ? - - - - 14. **What will be the out put of the following code.** for (var i = 0; i \< 3; i++) { setTimeout(function() { console.log(i); }, 100); } - - - - 15. **What will be the following code output** async function getData() { return await Promise.resolve(\'I made it!\'); } const data = getData(); console.log(data); - - - - 16. **Which of the following is a valid way to define an anonymous function?** - - - - 17. **How can you create an Immediately Invoked Function Expression (IIFE)?** - - - - - 18. **What does the following code do?** setTimeout(() =\> { console.log(\"Hello\"); }, 0); console.log(\"World\"); - - - - 19. **Interpret the pattern and solve the Logic **\ If Input: l1 = \[2,4,3\], l2 = \[5,6,4\] ;Then Output: 807; If Input: l1 = \[0,9,7\], l2 = \[3,8,9\] ; Then Output: ? Explanation: 20. **Given a string s, find the length of the longest substring without repeating characters.**\ Input: let s = \"abcabcbb\"; Output: 21. **Identify and fix the syntax error \[code language js\]:** let arr = \[1, 2, 3, 4, 5,"c,d"\];\ console.log arr\[2\]; Output: 22. **Identify and fix the syntax error:** function outerFunction(a) {\ function innerFunction(b) {\ return a + b;\ }\ return innerFunction;\ }\ console.log(outerFunction(5, 3)); Output: