Skip to content

alexkuznecov16/JavaScript-Coding-Interview-Questions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Basic JavaScript coding questions

Basic JavaScript programming language questions cover concepts like data types, variables and scoping, array, string manipulation, OOP (Object Oriented Programming), control flow, error handling, DOM (Document Object Model) manipulation, and asynchronous programming. Here are the basic JavaScript coding interview questions

1. Write a JavaScript function to calculate the sum of two numbers.

When managers ask this question, they are looking for the candidate’s basic understanding of JavaScript. They assess their understanding of basic syntax along with problem-solving skills. This also helps evaluate the candidate’s coding style and attention to detail.

2. Write a JavaScript program to find the maximum number in an array.

A hiring manager asks this question to analyze the candidate’s ability to write clear and efficient code. It’s crucial for candidates to explain the code step-by-step while demonstrating bug-free code.

3. Write a JavaScript function to check if a given string is a palindrome (reads the same forwards

and backwards). The interviewer is looking for the candidate’s familiarity with loop constructs, JavaScript string methods, and other basic JavaScript syntax. They will evaluate the candidate’s skills based on the approach used to solve the palindrome problem.

4. Write a JavaScript program to reverse a given string.

Hiring managers are expecting an accurate solution that demonstrates the interviewee’s proficiency in JavaScript programming.

5. Write a JavaScript function that takes an array of numbers and returns a new array with only the even numbers.

Interviewers are looking for candidates who can not only clearly explain the solution along with the code, but also show the ability to think logically and articulate their thought processes.

6. Write a JavaScript program to calculate the factorial of a given number.

By asking this question, managers aim to assess the candidate’s algorithmic thinking and understanding of JavaScript programming. The interviewer expects the candidate to demonstrate their knowledge of the factorial concept.

7. Write a JavaScript function to check if a given number is prime.

Interviewers can analyze the candidate’s knowledge of JavaScript algorithms and mathematical concepts. They expect the candidate to translate a mathematical concept into functional code.

8. Write a JavaScript function that returns the Fibonacci sequence up to a given number of terms.

This question helps hiring managers assess the interviewee’s understanding of fundamental algorithms in JavaScript. They expect the candidate to consider edge cases and handle errors.

9. Write a JavaScript program to convert a string to title case (capitalize the first letter of each word).

Interviewers analyze the candidate’s ability to break down a problem into manageable steps and demonstrate knowledge of string manipulation, looping, and basic JavaScript functions.

10. Write a JavaScript function that takes an array and returns various statistical measures (geometric mean, quadratic mean, arithmetic mean) and the array sorted in ascending and descending order.

Interviewers look for a candidate's understanding of different mathematical concepts and their ability to implement them in JavaScript. They also assess the ability to handle and manipulate arrays efficiently.

11. Write a JavaScript program to analyze a given text and output various properties.

This question assesses the candidate's ability to manipulate and analyze strings, arrays, and other data structures in JavaScript.

12. Write a JavaScript program to get the current date and time and update it.

Interviewers evaluate the candidate’s understanding of date and time manipulation in JavaScript, as well as their ability to work with asynchronous functions and intervals.

13. Write a JavaScript function to check if a given number is an Armstrong number.

This question helps assess the candidate's knowledge of mathematical concepts and their ability to implement complex algorithms in JavaScript.

Releases

No releases published

Packages

No packages published