{"id":12409,"date":"2024-08-21T10:00:01","date_gmt":"2024-08-21T04:30:01","guid":{"rendered":"https:\/\/www.placementpreparation.io\/blog\/?p=12409"},"modified":"2025-02-27T13:46:31","modified_gmt":"2025-02-27T08:16:31","slug":"javascript-interview-questions-for-freshers","status":"publish","type":"post","link":"https:\/\/www.placementpreparation.io\/blog\/javascript-interview-questions-for-freshers\/","title":{"rendered":"Top JavaScript Interview Questions for Freshers"},"content":{"rendered":"<?xml encoding=\"utf-8\" ?><p>Are you preparing for your first JavaScript interview and wondering what questions you might face? Understanding the key JavaScript interview questions for freshers can give you more clarity.<\/p><p>This blog is here to help you get ready with practical questions that test your real-world problem-solving skills. We&rsquo;ve gathered some of the most common basic JavaScript interview questions that freshers often encounter.<\/p><p>With this guide, you&rsquo;ll be well-prepared to tackle these JavaScript interview questions and answers for freshers and make a strong impression in your interview.<\/p><p><a href=\"https:\/\/www.guvi.in\/mlp\/fsd-student-program-wp?utm_source=placement_preparation&amp;utm_medium=blog_banner&amp;utm_campaign=javascript_interview_questions_for_freshers_horizontal\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" class=\"alignnone wp-image-14310 size-full\" src=\"https:\/\/www.placementpreparation.io\/blog\/wp-content\/uploads\/2025\/01\/fsd-student-program-banner-horizontal.webp\" alt=\"fsd student program banner horizontal\" width=\"2270\" height=\"600\" srcset=\"https:\/\/www.placementpreparation.io\/blog\/wp-content\/uploads\/2025\/01\/fsd-student-program-banner-horizontal.webp 2270w, https:\/\/www.placementpreparation.io\/blog\/wp-content\/uploads\/2025\/01\/fsd-student-program-banner-horizontal-300x79.webp 300w, https:\/\/www.placementpreparation.io\/blog\/wp-content\/uploads\/2025\/01\/fsd-student-program-banner-horizontal-1024x271.webp 1024w, https:\/\/www.placementpreparation.io\/blog\/wp-content\/uploads\/2025\/01\/fsd-student-program-banner-horizontal-768x203.webp 768w, https:\/\/www.placementpreparation.io\/blog\/wp-content\/uploads\/2025\/01\/fsd-student-program-banner-horizontal-1536x406.webp 1536w, https:\/\/www.placementpreparation.io\/blog\/wp-content\/uploads\/2025\/01\/fsd-student-program-banner-horizontal-2048x541.webp 2048w, https:\/\/www.placementpreparation.io\/blog\/wp-content\/uploads\/2025\/01\/fsd-student-program-banner-horizontal-150x40.webp 150w\" sizes=\"(max-width: 2270px) 100vw, 2270px\"><\/a><\/p><h2 id=\"practice-javascript-interview-questions\">Practice JavaScript Interview Questions and Answers<\/h2><p>Below are the top 50 Javascript interview questions for freshers with answers:<\/p><h3 id=\"what-is-javascript\">1. What is JavaScript, and how is it different from Java?<\/h3><p><strong>Answer:<\/strong><\/p><p>JavaScript is a scripting language primarily used for web development, whereas Java is a full-fledged programming language.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>\/\/ Example of JavaScript code<br>\nconsole.log(&ldquo;Hello, JavaScript!&rdquo;);<\/p>\n<\/div><\/div><h3 id=\"javascript-evolution-over-time\">2. How did JavaScript evolve over time?<\/h3><p><strong>Answer:<\/strong><\/p><p>JavaScript evolved from a simple scripting language to a powerful tool with features like ES6, async programming, and modules.<\/p><h3 id=\"setting-up-javascript-development\">3. How do you set up a basic JavaScript development environment?<\/h3><p><strong>Answer:<\/strong><\/p><p>Install Node.js for server-side development and use a code editor like VSCode for writing JavaScript code.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>node &ndash;version<\/p>\n<\/div><\/div><h3 id=\"browser-vs-node.js-javascript\">4. What is the difference between running JavaScript in the browser and in Node.js?<\/h3><p><strong>Answer:<\/strong><\/p><p>JavaScript in the browser is used for client-side interactions, while Node.js runs JavaScript on the server side.<\/p><h3 id=\"hello-world-program\">5. Write a simple JavaScript program that prints &ldquo;Hello, World!&rdquo; to the console.<\/h3><p><strong>Answer:<\/strong><\/p><p>Use <strong>console.log()<\/strong> to print messages to the console.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>console.log(&ldquo;Hello, World!&rdquo;);<\/p>\n<\/div><\/div><h3 id=\"declaring-variables-var-let-const\">6. How do you declare a variable in JavaScript, and what are the differences between var, let, and const?<\/h3><p><strong>Answer:<\/strong><\/p><p><strong>var<\/strong> is function-scoped, <strong>let<\/strong> and const are block-scoped, with <strong>const<\/strong> being immutable.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>let name = &ldquo;John&rdquo;;<br>\nconst age = 30;<\/p>\n<\/div><\/div><h3 id=\"equality-operators-==-vs-===\">7. Explain the difference between == and === in JavaScript.<\/h3><p><strong>Answer:<\/strong><\/p><p><strong>==<\/strong> checks for value equality, while <strong>===<\/strong> checks for both value and type equality.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>console.log(5 == &lsquo;5&rsquo;); \/\/ true<br>\nconsole.log(5 === &lsquo;5&rsquo;); \/\/ false<\/p>\n<\/div><\/div><h3 id=\"alert-prompt-and-confirm\">8. How do you create an alert, prompt, and confirm dialog in JavaScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>Use <strong>alert()<\/strong> to show messages, <strong>prompt()<\/strong> to get user input, and <strong>confirm()<\/strong> to get confirmation.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>alert(&ldquo;Hello!&rdquo;);<br>\nlet name = prompt(&ldquo;What&rsquo;s your name?&rdquo;);<br>\nlet isConfirmed = confirm(&ldquo;Are you sure?&rdquo;);<\/p>\n<\/div><\/div><h3 id=\"primitive-data-types\">9. What are primitive data types in JavaScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>Primitive data types include <strong>string<\/strong>, <strong>number<\/strong>, <strong>boolean<\/strong>, <strong>null<\/strong>, <strong>undefined<\/strong>, and <strong>symbol<\/strong>.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>let num = 42;<br>\nlet isActive = true;<\/p>\n<\/div><\/div><h3 id=\"arithmetic-operations\">10. Write a JavaScript program to calculate the sum of two numbers using arithmetic operators.<\/h3><p><strong>Answer:<\/strong><\/p><p>Use the <strong>+<\/strong> operator to sum two numbers.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>let a = 5;<br>\nlet b = 10;<br>\nlet sum = a + b;<br>\nconsole.log(sum);<\/p>\n<\/div><\/div><h3 id=\"positive-or-negative-number\">11. How do you use an if-else statement to check if a number is positive or negative?<\/h3><p><strong>Answer:<\/strong><\/p><p>Use <strong>if-else<\/strong> to conditionally check and execute code based on the number&rsquo;s value.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>let num = -5;<br>\nif (num &gt; 0) {<br>\nconsole.log(&ldquo;Positive&rdquo;);<br>\n} else {<br>\nconsole.log(&ldquo;Negative&rdquo;);<br>\n}<\/p>\n<\/div><\/div><h3 id=\"using-switch-statement\">12. Explain the use of the switch statement in JavaScript.<\/h3><p><strong>Answer:<\/strong><\/p><p><strong>switch<\/strong> is used for multiple conditions based on a single variable, offering a cleaner alternative to multiple <strong>if-else<\/strong> statements.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>let day = 2;<br>\nswitch (day) {<br>\ncase 1:<br>\nconsole.log(&ldquo;Monday&rdquo;);<br>\nbreak;<br>\ncase 2:<br>\nconsole.log(&ldquo;Tuesday&rdquo;);<br>\nbreak;<br>\ndefault:<br>\nconsole.log(&ldquo;Invalid day&rdquo;);<br>\n}<\/p>\n<\/div><\/div><h3 id=\"printing-numbers-1-to-10\">13. How do you write a for loop that prints numbers from 1 to 10?<\/h3><p><strong>Answer:<\/strong><\/p><p>Use a <strong>for<\/strong> loop to iterate from 1 to 10 and print each number.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>for (let i = 1; i &lt;= 10; i++) {<br>\nconsole.log(i);<br>\n}<\/p>\n<\/div><\/div><h3 id=\"while-vs-do-while-loops\">14. What is the difference between while and do-while loops in JavaScript?<\/h3><p><strong>Answer:<\/strong><\/p><p><strong>while<\/strong> loops check the condition before execution, while <strong>do-while<\/strong> loops execute the block at least once before checking the condition.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>let i = 1;<br>\ndo {<br>\nconsole.log(i);<br>\ni++;<br>\n} while (i &lt;= 5);<\/p>\n<\/div><\/div><h3 id=\"printing-even-numbers\">15. Write a JavaScript program to print all even numbers from 1 to 20 using a loop and the continue statement.<\/h3><p><strong>Answer:<\/strong><\/p><p>Use <strong>continue<\/strong> to skip odd numbers and print only even numbers.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>for (let i = 1; i &lt;= 20; i++) {<br>\nif (i % 2 !== 0) continue;<br>\nconsole.log(i);<br>\n}<\/p>\n<\/div><\/div><h3 id=\"function-declaration-vs-expression\">16. What is the difference between function declaration and function expression in JavaScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>Function declarations are hoisted, while function expressions are not.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>function greet() {<br>\nreturn &ldquo;Hello!&rdquo;;<br>\n}<\/p>\n<p>const greetExpression = function() {<br>\nreturn &ldquo;Hello!&rdquo;;<br>\n};<\/p>\n<\/div><\/div><h3 id=\"function-parameters-and-arguments\">17. How do you use parameters and arguments in a JavaScript function?<\/h3><p><strong>Answer:<\/strong><\/p><p>Parameters are placeholders in the function definition, while arguments are the actual values passed to the function.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>function add(a, b) {<br>\nreturn a + b;<br>\n}<\/p>\n<p>console.log(add(5, 10)); \/\/ 15<\/p>\n<\/div><\/div><h3 id=\"function-return-statement\">18. Explain how the return statement works in a function.<\/h3><p><strong>Answer:<\/strong><\/p><p>The <strong>return<\/strong> statement exits the function and optionally returns a value to the caller.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>function multiply(a, b) {<br>\nreturn a * b;<br>\n}<\/p>\n<p>let result = multiply(3, 4); \/\/ 12<\/p>\n<\/div><\/div><h3 id=\"arrow-functions-vs-regular\">19. What are arrow functions in JavaScript, and how do they differ from regular functions?<\/h3><p><strong>Answer:<\/strong><\/p><p>Arrow functions are a shorter syntax for functions and do not have their own <strong>this<\/strong> context.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>const sum = (a, b) =&gt; a + b;<\/p>\n<\/div><\/div><h3 id=\"immediately-invoked-function-expression\">20. Write a JavaScript program using an Immediately Invoked Function Expression (IIFE).<\/h3><p><strong>Answer:<\/strong><\/p><p>IIFEs are functions that execute immediately after they are defined.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>(function() {<br>\nconsole.log(&ldquo;IIFE executed&rdquo;);<br>\n})();<\/p>\n<\/div><\/div><h3 id=\"creating-and-accessing-objects\">21. How do you create an object in JavaScript, and how can you access its properties?<\/h3><p><strong>Answer:<\/strong><\/p><p>Create an object using curly braces <strong>{}<\/strong> and access properties using dot notation or bracket notation.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>let person = { name: &ldquo;John&rdquo;, age: 30 };<br>\nconsole.log(person.name); \/\/ John<\/p>\n<\/div><\/div><h3 id=\"understanding-this-keyword\">22. Explain the use of the this keyword in JavaScript.<\/h3><p><strong>Answer:<\/strong><\/p><p><strong>this<\/strong> refers to the object that is currently calling the method or the global object in a function.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>let person = {<br>\nname: &ldquo;John&rdquo;,<br>\ngreet: function() {<br>\nconsole.log(this.name);<br>\n}<br>\n};<\/p>\n<p>person.greet(); \/\/ John<\/p>\n<\/div><\/div><h3 id=\"array-manipulation-methods\">23. How do you add and remove elements from an array using push, pop, shift, and unshift methods?<\/h3><p><strong>Answer:<\/strong><\/p><p><strong>push<\/strong> adds to the end, <strong>pop<\/strong> removes from the end, <strong>shift<\/strong> removes from the beginning, and <strong>unshift<\/strong> adds to the beginning of an array.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>let arr = [1, 2, 3];<br>\narr.push(4); \/\/ [1, 2, 3, 4]\narr.pop(); \/\/ [1, 2, 3]\n<\/p><\/div><\/div><h3 id=\"map()-vs-foreach()\">24. What is the difference between map() and forEach() when working with arrays?<\/h3><p><strong>Answer:<\/strong><\/p><p><strong>map<\/strong> returns a new array with the results of calling a function on every element, while <strong>forEach<\/strong> executes a function on each element without returning a new array.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>let arr = [1, 2, 3];<br>\nlet doubled = arr.map(x =&gt; x * 2); \/\/ [2, 4, 6]\n<\/p><\/div><\/div><h3 id=\"filtering-even-numbers\">25. Write a JavaScript program to filter an array of numbers and return only the even numbers.<\/h3><p><strong>Answer:<\/strong><\/p><p>Use the <strong>filter()<\/strong> method to create a new array with elements that pass a test.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>let numbers = [1, 2, 3, 4, 5, 6];<br>\nlet evenNumbers = numbers.filter(num =&gt; num % 2 === 0);<br>\nconsole.log(evenNumbers); \/\/ [2, 4, 6]\n<\/p><\/div><\/div><h3 id=\"finding-string-length\">26. How do you find the length of a string in JavaScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>Use the <strong>length<\/strong> property to find the number of characters in a string.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>let str = &ldquo;Hello, World!&rdquo;;<br>\nconsole.log(str.length); \/\/ 13<\/p>\n<\/div><\/div><h3 id=\"converting-to-uppercase\">27. Write a JavaScript program to convert a string to uppercase.<\/h3><p><strong>Answer:<\/strong><\/p><p>Use the <strong>toUpperCase()<\/strong> method to convert a string to uppercase.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>let str = &ldquo;hello&rdquo;;<br>\nconsole.log(str.toUpperCase()); \/\/ HELLO<\/p>\n<\/div><\/div><h3 id=\"substring-extraction-slice-substring\">28. How do you extract a substring from a string using slice() and substring()?<\/h3><p><strong>Answer:<\/strong><\/p><p>Both <strong>slice()<\/strong> and <strong>substring()<\/strong> extract parts of a string, but <strong>slice()<\/strong> can accept negative indices.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>let str = &ldquo;Hello, World!&rdquo;;<br>\nconsole.log(str.slice(0, 5)); \/\/ Hello<br>\nconsole.log(str.substring(0, 5)); \/\/ Hello<\/p>\n<\/div><\/div><h3 id=\"using-template-literals\">29. What is the use of template literals in JavaScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>Template literals allow embedding expressions inside strings using backticks <strong>&ldquo;<\/strong> and <strong>${}<\/strong>.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>let name = &ldquo;John&rdquo;;<br>\nlet greeting = `Hello, ${name}!`;<br>\nconsole.log(greeting); \/\/ Hello, John!<\/p>\n<\/div><\/div><h3 id=\"replacing-string-substrings\">30. Write a JavaScript program to replace all occurrences of a substring in a string.<\/h3><p><strong>Answer:<\/strong><\/p><p>Use the <strong>replace()<\/strong> method with a regular expression to replace all occurrences of a substring.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>let str = &ldquo;foo bar foo&rdquo;;<br>\nlet newStr = str.replace(\/foo\/g, &ldquo;baz&rdquo;);<br>\nconsole.log(newStr); \/\/ baz bar baz<\/p>\n<\/div><\/div><h3 id=\"selecting-element-by-id\">31. How do you select an HTML element by its ID in JavaScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>Use <strong>document.getElementById()<\/strong> to select an element by its ID.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>let element = document.getElementById(&ldquo;myElement&rdquo;);<\/p>\n<\/div><\/div><h3 id=\"changing-element-text-content\">32. Write a JavaScript program to change the text content of an HTML element.<\/h3><p><strong>Answer:<\/strong><\/p><p>Use the <strong>textContent<\/strong> property to change the text inside an HTML element.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>let element = document.getElementById(&ldquo;myElement&rdquo;);<br>\nelement.textContent = &ldquo;New Text&rdquo;;<\/p>\n<\/div><\/div><h3 id=\"adding-event-listeners\">33. How do you add an event listener to an HTML element in JavaScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>Use <strong>addEventListener()<\/strong> to attach an event handler to an HTML element.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>let button = document.getElementById(&ldquo;myButton&rdquo;);<br>\nbutton.addEventListener(&ldquo;click&rdquo;, () =&gt; {<br>\nalert(&ldquo;Button clicked!&rdquo;);<br>\n});<\/p>\n<\/div><\/div><h3 id=\"event-propagation-explanation\">34. What is event propagation, and how does it work in JavaScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>Event propagation refers to the order in which events are handled, including capturing, target, and bubbling phases.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>Document. getElementById(&ldquo;parent&rdquo;).addEventListener(&ldquo;click&rdquo;, () =&gt; {<br>\nconsole.log(&ldquo;Parent clicked&rdquo;);<br>\n}, true); \/\/ Capturing phase<\/p>\n<\/div><\/div><h3 id=\"dynamically-creating-elements\">35. Write a JavaScript program to dynamically create and append an HTML element.<\/h3><p><strong>Answer:<\/strong><\/p><p>Use <strong>document.createElement()<\/strong> and <strong>appendChild()<\/strong> to dynamically create and add elements to the DOM.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>let newElement = document.createElement(&ldquo;div&rdquo;);<br>\nnewElement.textContent = &ldquo;Hello, World!&rdquo;;<br>\ndocument.body.appendChild(newElement);<\/p>\n<\/div><\/div><h3 id=\"function-hoisting-concept\">36. Explain function hoisting in JavaScript.<\/h3><p><strong>Answer:<\/strong><\/p><p>Function declarations are hoisted to the top of their scope, allowing them to be called before they are defined.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>console.log(greet()); \/\/ Hello<\/p>\n<p>function greet() {<br>\nreturn &ldquo;Hello&rdquo;;<br>\n}<\/p>\n<\/div><\/div><h3 id=\"implementing-recursion\">37. What is recursion, and how do you implement it in JavaScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>Recursion is when a function calls itself, used to solve problems that can be broken down into similar sub-problems.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>function factorial(n) {<br>\nreturn n &lt;= 1 ? 1 : n * factorial(n &ndash; 1);<br>\n}<br>\nconsole.log(factorial(5)); \/\/ 120<\/p>\n<\/div><\/div><h3 id=\"understanding-closures\">38. What are closures in JavaScript, and why are they important?<\/h3><p><strong>Answer:<\/strong><\/p><p>Closures are functions that remember the scope in which they were created, allowing them to access variables from that scope.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>function outer() {<br>\nlet count = 0;<br>\nreturn function() {<br>\nreturn ++count;<br>\n};<br>\n}<br>\nconst increment = outer();<br>\nconsole.log(increment()); \/\/ 1<\/p>\n<\/div><\/div><h3 id=\"bind()-call()-and-apply()\">39. How do you use bind(), call(), and apply() methods in JavaScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>These methods are used to change the <strong>this<\/strong> context of a function, with <strong>call()<\/strong> and <strong>apply()<\/strong> invoking the function immediately.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>let obj = { num: 2 };<br>\nfunction multiply(a, b) {<br>\nreturn this.num * a * b;<br>\n}<br>\nconsole.log(multiply.call(obj, 3, 4)); \/\/ 24<\/p>\n<\/div><\/div><h3 id=\"implementing-function-currying\">40. What is function currying, and how do you implement it in JavaScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>Currying transforms a function with multiple arguments into a series of functions that each take a single argument.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>function add(a) {<br>\nreturn function(b) {<br>\nreturn a + b;<br>\n};<br>\n}<br>\nconsole.log(add(2)(3)); \/\/ 5<\/p>\n<\/div><\/div><h3 id=\"try-catch-finally-error-handling\">41. How do you handle errors in JavaScript using try, catch, and finally?<\/h3><p><strong>Answer:<\/strong><\/p><p>Wrap code that may throw errors in a <strong>try<\/strong> block, handle the error in <strong>catch<\/strong>, and optionally execute code in <strong>finally<\/strong>.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>try {<br>\nlet result = someUndefinedFunction();<br>\n} catch (error) {<br>\nconsole.log(&ldquo;An error occurred: &rdquo; + error.message);<br>\n} finally {<br>\nconsole.log(&ldquo;This runs no matter what&rdquo;);<br>\n}<\/p>\n<\/div><\/div><h3 id=\"throwing-custom-errors\">42. Write a JavaScript program that throws a custom error if a number is negative.<\/h3><p><strong>Answer:<\/strong><\/p><p>Use <strong>throw<\/strong> to create and throw a custom error based on a condition.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>function checkPositive(num) {<br>\nif (num &lt; 0) {<br>\nthrow new Error(&ldquo;Number is negative&rdquo;);<br>\n}<br>\nreturn num;<br>\n}<br>\ntry {<br>\nconsole.log(checkPositive(-5));<br>\n} catch (error) {<br>\nconsole.log(error.message);<br>\n}<\/p>\n<\/div><\/div><h3 id=\"types-of-javascript-errors\">43. What are the different types of errors in JavaScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>Common error types include <strong>SyntaxError<\/strong>, <strong>ReferenceError<\/strong>, <strong>TypeError<\/strong>, and <strong>RangeError<\/strong>.<\/p><h3 id=\"debugging-javascript-in-browser\">44. How do you debug JavaScript code in the browser?<\/h3><p><strong>Answer:<\/strong><\/p><p>Use the browser&rsquo;s developer tools to set breakpoints, inspect variables, and step through code.<\/p><h3 id=\"concept-of-stack-trace\">45. Explain the concept of stack trace in JavaScript error handling.<\/h3><p><strong>Answer:<\/strong><\/p><p>A stack trace shows the sequence of function calls that led to an error, helping in debugging.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>function a() { b(); }<br>\nfunction b() { c(); }<br>\nfunction c() { throw new Error(&ldquo;Oops!&rdquo;); }<br>\na(); \/\/ Stack trace will show a -&gt; b -&gt; c<\/p>\n<\/div><\/div><h3 id=\"callback-functions-in-async\">46. What is a callback function, and how is it used in asynchronous JavaScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>A callback function is passed as an argument to another function and executed after the completion of a task.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>function fetchData(callback) {<br>\nsetTimeout(() =&gt; {<br>\ncallback(&ldquo;Data received&rdquo;);<br>\n}, 1000);<br>\n}<\/p>\n<p>fetchData((data) =&gt; {<br>\nconsole.log(data);<br>\n});<\/p>\n<\/div><\/div><h3 id=\"creating-and-using-promises\">47. How do you create and use a promise in JavaScript?<\/h3><p><strong>Answer:<\/strong><\/p><p>A promise represents the eventual completion (or failure) of an asynchronous operation and its resulting value.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>let promise = new Promise((resolve, reject) =&gt; {<br>\nsetTimeout(() =&gt; resolve(&ldquo;Success&rdquo;), 1000);<br>\n});<\/p>\n<p>promise.then(result =&gt; console.log(result));<\/p>\n<\/div><\/div><h3 id=\"async-and-await-usage\">48. What is the purpose of async and await in JavaScript?<\/h3><p><strong>Answer:<\/strong><\/p><p><strong>async<\/strong> and <strong>await<\/strong> simplify asynchronous code, making it look and behave more like synchronous code.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>async function fetchData() {<br>\nlet data = await new Promise((resolve) =&gt; setTimeout(() =&gt; resolve(&ldquo;Data received&rdquo;), 1000));<br>\nconsole.log(data);<br>\n}<br>\nfetchData();<\/p>\n<\/div><\/div><h3 id=\"fetching-data-from-api\">49. Write a JavaScript program to fetch data from an API using fetch and handle errors.<\/h3><p><strong>Answer:<\/strong><\/p><p>Use the <strong>fetch<\/strong> API for making HTTP requests and handle errors with <strong>.catch()<\/strong>.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>fetch(&ldquo;https:\/\/api.example.com\/data&rdquo;)<br>\n.then(response =&gt; response.json())<br>\n.then(data =&gt; console.log(data))<br>\n.catch(error =&gt; console.error(&ldquo;Error fetching data:&rdquo;, error));<\/p>\n<\/div><\/div><h3 id=\"handling-async-errors-with-try-catch\">50. How do you handle errors in asynchronous code using try-catch with async-await?<\/h3><p><strong>Answer:<\/strong><\/p><p>Wrap the <strong>await<\/strong> calls in a <strong>try-catch<\/strong> block to handle errors in asynchronous functions.<\/p><div class=\"su-note\" style=\"border-color:#e5dbc7;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#FFF5E1;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;\">\n<p>async function fetchData() {<br>\ntry {<br>\nlet response = await fetch(&ldquo;https:\/\/api.example.com\/data&rdquo;);<br>\nlet data = await response.json();<br>\nconsole.log(data);<br>\n} catch (error) {<br>\nconsole.error(&ldquo;Error fetching data:&rdquo;, error);<br>\n}<br>\n}<br>\nfetchData();<\/p>\n<\/div><\/div><h2>Final Words<\/h2><p>Getting ready for an interview can feel overwhelming, but going through these JavaScript fresher interview questions can help you feel more confident. This guide focuses on the kinds of JavaScript developer interview questions for fresher roles that you&rsquo;re likely to face.<\/p><p>Don&rsquo;t forget to practice the JavaScript basic coding interview questions too! With the right preparation, you&rsquo;ll ace your JavaScript interview and take that important step in your career.<\/p><hr><h2>Frequently Asked Questions<\/h2><h3>1. What are the most common interview questions for JavaScript?<\/h3><p>The most common JavaScript interview questions often cover topics like closures, hoisting, event handling, and basic DOM manipulation.<\/p><h3>2. What are the important JavaScript topics freshers should focus on for interviews?<\/h3><p>Freshers should focus on understanding concepts like scope, functions, ES6 features, promises, and async\/await.<\/p><h3>3. How should freshers prepare for JavaScript technical interviews?<\/h3><p>Freshers should practice writing clean, efficient code, understand core JavaScript concepts, and solve a variety of coding problems.<\/p><h3>4. What strategies can freshers use to solve JavaScript coding questions during interviews?<\/h3><p>Freshers should break down problems, write pseudocode first, and thoroughly test their code with different inputs.<\/p><h3>5. Should freshers prepare for advanced JavaScript topics in interviews?<\/h3><p>Yes, depending on the role, freshers might need to know advanced topics like closures, asynchronous programming, and design patterns.<\/p><hr><h2>Explore More JavaScript Resources<\/h2><ul class=\"explore-more\">\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/best-websites-to-learn-javascript\/\">JavaScript Learning Websites<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/best-websites-to-practice-javascript\/\">JavaScript Practice Websites<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/best-youtube-channels-to-learn-javascript\/\">JavaScript YouTube Channels<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/javascript-project-ideas-for-beginners\/\">JavaScript Project Ideas<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/best-javascript-frameworks\/\">JavaScript Frameworks<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/best-apps-to-learn-javascript\/\">JavaScript Apps<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/javascript-ides-and-code-editors\/\">JavaScript IDEs<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/mcq\/javascript\/\">JavaScript MCQ<\/a><\/li>\n<\/ul><h2>Explore More Interview Questions<\/h2><ul class=\"explore-more\">\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/python-interview-questions-for-freshers\/\">Python<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/java-interview-questions-for-freshers\/\">Java<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/sql-interview-questions-for-freshers\/\">SQL<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/react-interview-questions-for-freshers\/\">React<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/c-programming-interview-questions-for-freshers\/\">C Programming<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/html-interview-questions-for-freshers\/\">HTML<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/css-interview-questions-for-freshers\/\">CSS<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/angular-interview-questions-for-freshers\/\">Angular<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/cpp-interview-questions-for-freshers\/\">C++<\/a><\/li>\n<li><a href=\"https:\/\/www.placementpreparation.io\/blog\/spring-boot-interview-questions-for-freshers\/\">Spring Boot<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Are you preparing for your first JavaScript interview and wondering what questions you might face? Understanding the key JavaScript interview questions for freshers can give you more clarity.This blog is here to help you get ready with practical questions that test your real-world problem-solving skills. We&rsquo;ve gathered some of the most common basic JavaScript interview [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":12447,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[45],"tags":[],"class_list":["post-12409","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programming-interview-questions"],"_links":{"self":[{"href":"https:\/\/www.placementpreparation.io\/blog\/wp-json\/wp\/v2\/posts\/12409","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.placementpreparation.io\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.placementpreparation.io\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.placementpreparation.io\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.placementpreparation.io\/blog\/wp-json\/wp\/v2\/comments?post=12409"}],"version-history":[{"count":6,"href":"https:\/\/www.placementpreparation.io\/blog\/wp-json\/wp\/v2\/posts\/12409\/revisions"}],"predecessor-version":[{"id":14884,"href":"https:\/\/www.placementpreparation.io\/blog\/wp-json\/wp\/v2\/posts\/12409\/revisions\/14884"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.placementpreparation.io\/blog\/wp-json\/wp\/v2\/media\/12447"}],"wp:attachment":[{"href":"https:\/\/www.placementpreparation.io\/blog\/wp-json\/wp\/v2\/media?parent=12409"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.placementpreparation.io\/blog\/wp-json\/wp\/v2\/categories?post=12409"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.placementpreparation.io\/blog\/wp-json\/wp\/v2\/tags?post=12409"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}