0% found this document useful (0 votes)
5 views

javascript_coding_questions_complete

This document lists 100 essential JavaScript machine coding questions commonly asked in fresher interviews, covering a range of topics from basic to advanced concepts. The questions include tasks related to data structures, algorithms, and real-world problem-solving scenarios. Each question is designed to test the candidate's coding skills and understanding of JavaScript.

Uploaded by

Umair Kidwai
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

javascript_coding_questions_complete

This document lists 100 essential JavaScript machine coding questions commonly asked in fresher interviews, covering a range of topics from basic to advanced concepts. The questions include tasks related to data structures, algorithms, and real-world problem-solving scenarios. Each question is designed to test the candidate's coding skills and understanding of JavaScript.

Uploaded by

Umair Kidwai
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

100 Most Important Machine Coding Questions

This document contains 100 essential JavaScript machine coding questions frequently asked in
fresher interviews. The questions cover basic to advanced concepts, including data structures,
problem-solving, and real-world scenarios.

JavaScript Machine Coding Questions

1. Write a function to reverse a string.

2. Implement a function to check if a string is a palindrome.

3. Write a function to find the factorial of a number.

4. Implement a function to find the Fibonacci series up to n terms.

5. Write a function to check if a number is prime.

6. Implement a function to find the largest element in an array.

7. Write a function to find the second largest number in an array.

8. Implement a function to find the missing number in an array of 1 to n.

9. Write a function to find the duplicate elements in an array.

10. Implement a function to check if two strings are anagrams.

11. Write a function to flatten a nested array.

12. Implement a debounce function in JavaScript.

13. Write a throttle function in JavaScript.

14. Implement a function to deep clone an object.

15. Write a function to merge two sorted arrays.

16. Implement a function to rotate an array by k positions.

17. Write a function to remove duplicates from an array.

18. Implement a function to count the occurrences of elements in an array.

19. Write a function to find the intersection of two arrays.

20. Implement a function to find the union of two arrays.


21. Write a function to check if a string contains only digits.

22. Implement a function to convert a string to camelCase.

23. Write a function to convert a string to snake_case.

24. Implement a function to find the longest word in a sentence.

25. Write a function to capitalize the first letter of each word in a string.

26. Implement a function to shuffle elements in an array.

27. Write a function to find the first non-repeating character in a string.

28. Implement a function to perform binary search on a sorted array.

29. Write a function to implement the bubble sort algorithm.

30. Implement the quick sort algorithm in JavaScript.

31. Write a function to implement the merge sort algorithm.

32. Implement a function to check if an object is empty.

33. Write a function to find the maximum depth of a nested object.

34. Implement a function to calculate the sum of all elements in an array.

35. Write a function to implement a simple promise.

36. Implement a function to fetch data using async/await.

37. Write a function to simulate a delay using setTimeout.

38. Implement a function to perform a deep comparison between two objects.

39. Write a function to check if an array is sorted.

40. Implement a function to count the number of words in a string.

41. Write a function to check if an object contains a specific key.

42. Implement a function to find the nth Fibonacci number using recursion.

43. Write a function to calculate the power of a number.

44. Implement a function to find the median of an array.

45. Write a function to implement a stack using an array.

46. Implement a function to implement a queue using an array.

47. Write a function to find the longest common prefix among an array of strings.
48. Implement a function to convert an integer to a Roman numeral.

49. Write a function to implement an LRU cache.

50. Implement a function to check if a number is an Armstrong number.

51. Write a function to generate all permutations of a given string.

52. Implement a function to remove all falsy values from an array.

53. Write a function to convert a number to binary.

54. Implement a function to check if a number is a perfect square.

55. Write a function to find the longest increasing subsequence in an array.

56. Implement a function to determine if a number is a power of two.

57. Write a function to compute the greatest common divisor (GCD) of two numbers.

58. Implement a function to compute the least common multiple (LCM) of two numbers.

59. Write a function to implement a basic event emitter.

60. Implement a function to group elements of an array based on a given condition.

61. Write a function to generate Fibonacci numbers using memoization.

62. Implement a function to validate an email address.

63. Write a function to validate a phone number.

64. Implement a function to parse a query string into an object.

65. Write a function to convert an object into a query string.

66. Implement a function to find the kth smallest element in an array.

67. Write a function to check if a string is a valid JSON.

68. Implement a function to sort an array of objects based on a key.

69. Write a function to merge overlapping intervals in an array.

70. Implement a function to find the largest sum of contiguous subarray (Kadanes Algorithm).

71. Write a function to implement a binary tree in JavaScript.

72. Implement a function to perform in-order traversal of a binary tree.

73. Write a function to perform pre-order traversal of a binary tree.

74. Implement a function to perform post-order traversal of a binary tree.


75. Write a function to check if a binary tree is balanced.

76. Implement a function to find the lowest common ancestor in a binary tree.

77. Write a function to serialize and deserialize a binary tree.

78. Implement a function to find the shortest path in a grid using BFS.

79. Write a function to detect a cycle in a directed graph.

80. Implement a function to find the topological sorting of a graph.

81. Write a function to implement a Trie (Prefix Tree).

82. Implement a function to perform word search in a 2D grid.

83. Write a function to find the maximum product of three numbers in an array.

84. Implement a function to calculate the sum of all left leaves in a binary tree.

85. Write a function to determine if a given string is valid parentheses.

86. Implement a function to count the number of islands in a 2D matrix.

87. Write a function to implement a circular queue.

88. Implement a function to implement a priority queue.

89. Write a function to implement a graph using adjacency list.

90. Implement a function to perform DFS on a graph.

91. Write a function to perform BFS on a graph.

92. Implement a function to find the diameter of a binary tree.

93. Write a function to find the minimum spanning tree of a graph.

94. Implement a function to find the shortest path in a weighted graph using Dijkstras algorithm.

95. Write a function to find the longest palindrome substring in a string.

96. Implement a function to perform matrix multiplication.

97. Write a function to implement a rate limiter.

98. Implement a function to simulate an API request with retry logic.

99. Write a function to generate a random alphanumeric string.

100. Implement a function to create a promise-based delay function.

You might also like