TGViewer
Coding Interview Preparation Coding Interview Preparation @coding_interview_preparation · 5.9K subscribers
Post #1463 62
Java Coding Interview Questions

Easy

1. Reverse a string without using a built-in reverse function.
2. Find the largest and smallest element in an array.
3. Check whether a string is a palindrome.
4. Check whether two strings are anagrams.
5. Remove duplicate elements from an array.
6. Count the frequency of each element in an array.
7. Find the intersection of two arrays.
8. Move all zeros in an array to the end while maintaining the order of the other elements.
9. Check whether a number is prime.
10. Find the factorial of a number using recursion.
11. Generate the Fibonacci sequence using both iteration and recursion.
12. Check whether a number is a palindrome.
13. Find the greatest common divisor of two numbers.
14. Implement linear search without using built-in search functions.
15. Sort an array using bubble sort.
16. Sort an array using insertion sort.
17. Sort an array using selection sort.

Medium

18. Find the second largest element in an array without sorting the array.
19. Find the first non-repeating character in a string.
20. Find the missing number in an array containing numbers from 1 to n.
21. Find all duplicate elements in an array.
22. Find the maximum sum of a contiguous subarray.
23. Merge two sorted arrays into one sorted array.
24. Find whether an array contains two numbers that add up to a given target.
25. Rotate an array to the right by k positions.
26. Find the longest substring without repeating characters.
27. Reverse an integer without converting it to a string.
28. Implement binary search on a sorted array.
29. Implement a stack using an array.
30. Implement a queue using an array.
31. Reverse a linked list.
32. Find the middle node of a linked list.
33. Merge two sorted linked lists.
34. Implement a function to check whether parentheses are balanced.

Hard

35. Detect whether a linked list contains a cycle.
36. Find the height of a binary tree.
37. Perform inorder, preorder, and postorder traversal of a binary tree.
38. Find the maximum depth of a binary tree.
39. Determine whether two binary trees are identical.
40. Find the lowest common ancestor of two nodes in a binary tree.
  • ❤ 1
More from @coding_interview_preparation
  1. Oct 10, 2026100 SQL interview questions
  2. Oct 8, 2026If you're prepping for system design interviews, this repo is gold It contains a curated,…
  3. Oct 6, 2026document post
  4. Oct 4, 2026💼 Why Your Resume Gets Rejected Before a Human Reads It You may have good skills and proj…
  5. Oct 2, 2026🧠 Coding Myths You Should Stop Believing There's a lot of advice online about learning to…
  6. Oct 1, 2026Most Asked Topics in AI Engineer Interviews Based on 2026 candidate reports
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →