Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Advanced JavaScript interview coding questions

  1. Reverse a String: Write a function that takes a string as input and returns the reverse of that string.

  2. Find the Longest Word: Write a function that takes a sentence as input and returns the longest word in that sentence.

  3. Remove Duplicates from an Array: Write a function that takes an array as input and removes all duplicate elements, returning a new array without duplicates.

  4. Flatten an Array: Write a function that takes an array of nested arrays and flattens it into a single-level array.

  5. Implement a Linked List: Create a class that represents a linked list and implement methods to add, remove, and search for elements in the list.

  6. Implement a Stack: Create a class that represents a stack and implement methods to push, pop, and peek elements in the stack.

  7. Implement a Queue: Create a class that represents a queue and implement methods to enqueue, dequeue, and peek elements in the queue.

  8. Validate Parentheses: Write a function that takes a string containing parentheses as input and checks if the parentheses are balanced and properly nested.

  9. Find the Median of Two Sorted Arrays: Write a function that takes two sorted arrays as input and returns the median value of the combined array.

  10. Implement Binary Search: Write a function that performs a binary search on a sorted array and returns the index of a given element, or -1 if it is not found. Certainly! Here are some more advanced JavaScript interview coding questions:

  11. Implement a Trie: Create a class that represents a trie (prefix tree) and implement methods to insert, search, and delete words.

  12. Find the Missing Number: Write a function that takes an array of numbers from 1 to n (with one number missing) and returns the missing number.

  13. Merge Sort: Implement the merge sort algorithm to sort an array of numbers in ascending order.

  14. Check Palindrome: Write a function that takes a string as input and checks if it is a palindrome (reads the same forwards and backwards).

  15. Deep Clone an Object: Write a function that performs a deep clone of an object, creating a new object with the same properties and values.

  16. Implement a Binary Tree: Create a class that represents a binary tree and implement methods to insert, search, and traverse the tree.

  17. Find the Intersection of Two Arrays: Write a function that takes two arrays as input and returns an array containing the common elements found in both arrays.

  18. Reverse a Linked List: Write a function that takes a linked list and reverses its order.

  19. Implement a Hash Table: Create a class that represents a hash table and implement methods to insert, retrieve, and remove key-value pairs.

  20. Find the Maximum Subarray Sum: Write a function that takes an array of integers and returns the maximum sum of a contiguous subarray.