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

code test

The document provides a comprehensive list of Java coding interview questions and problems, categorized by topics such as Strings, Arrays, Sorting, Searching, and more. It includes various algorithms and data structures, along with specific challenges like checking anagrams, sorting arrays, and dynamic programming problems. Additionally, it highlights competitive programming problems and offers insights into interview preparation strategies.

Uploaded by

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

code test

The document provides a comprehensive list of Java coding interview questions and problems, categorized by topics such as Strings, Arrays, Sorting, Searching, and more. It includes various algorithms and data structures, along with specific challenges like checking anagrams, sorting arrays, and dynamic programming problems. Additionally, it highlights competitive programming problems and offers insights into interview preparation strategies.

Uploaded by

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

https://java2blog.

com/java-coding-interview-questions/
#Question_2_Write_a_java_program_to_check_if_two_Strings_are_anagram_in_java

https://javaconceptoftheday.com/java-program-to-reverse-a-string/

String

Run-length encoding (find/print frequency of letters in a string)


Checking Anagrams (check whether two string is anagrams or not)
Count and Say sequence
Longest Common Prefix
Count Substrings
Number following the pattern
Next Permutation
Convert Ternary Expression to Binary Tree
Count of strings that can be formed using a, b and c under given constraints
Minimum Number of Flips
Count Occurrences of Anagrams
Rearrange a string
Print bracket number
Longest Palindromic Subsequence
Preorder to Postorder of BST
Maximum difference of zeros and ones in binary string
Sum of all substrings of a number
NAJPF - Pattern Find
Arrays

Sort an array of 0's, 1's and 2's in linear time complexity


Check for Valid Sudoku
Palindromic Array
Largest Fibonacci Subsequence
Pairs of songs with total durations divisible by 60
All subarray Sum of an array
Suggesting movie randomly from a list C++ program
Bus Routes Google Code Jam Round B Problem No. 2 Solution
Bike Tour Google Kick Start Round B Problem 1 Solution
Sorting

Sort an array of 0's, 1's and 2's in linear time complexity


Relative sorting algorithm
Weighted Job Scheduling
Merge K Sorted Arrays
Sort K-Sorted Array
N Max Pair Combinations
Searching

Finding First Bad Version


Maximum value in a bitonic array
Search for a Range
Floor and Ceil Value
First and last occurrence of an element
Find Minimum in Rotated Sorted Array
Coding Algorithms

Run-length encoding (find/print frequency of letters in a string)


Sort an array of 0's, 1's and 2's in linear time complexity
Finding subarray with given sum
1[0]1 Pattern Count
Capitalize first and last letter of each word in a line
Greedy Strategy to solve major algorithm problems
Job sequencing problem
Exit Point in a Matrix
Generate Gray Code Sequences
Picking Numbers
Tree

Find the level in a binary tree with given sum K


Check whether a Binary Tree is BST (Binary Search Tree) or not
Print vertical sum of a binary tree
Print Boundary Sum of a Binary Tree
Root to leaf Path Sum
Print All Nodes that don't have Sibling
Two Mirror Trees
Transform to Sum Tree
Symmetric Tree
Convert Sorted Array to Binary Search Tree
Odd even level difference in a binary tree
Check if Tree is Isomorphic
Expression Tree
K distance from root
Right View of Binary Tree
Diameter of Binary Tree
Delete nodes greater than or equal to k in a BST
Reverse Level Order Traversal
Diagonal Traversal of Binary Tree
Leftmost and Rightmost Nodes of Binary Tree
Lowest Common Ancestor in a BST
Convert Ternary Expression to Binary Tree
Bottom View of Binary Tree
Ancestors in Binary Tree
All Root to Leaf Paths
Sum of all numbers formed by root to leaf path
Minimum distance between two given nodes of a Binary Tree
K-th smallest element in a Binary Search Tree
Level order traversal in spiral form
Maximum path sum in a binary tree
Preorder to Postorder of BST
Check Mirror in N-ary Tree
Count Number of Nodes in a Complete Binary Tree (Leetcode Problem Solution)
Stack

Number following the pattern


Print bracket number
Stock Span Problem
Redundant Bracket
Postfix Expression Evaluation
Largest rectangle area in a histogram
Minimum Add to Make Parentheses Valid
Check Mirror in N-ary Tree
Queue

Check Mirror in N-ary Tree


Linked list

Reverse a single linked list


Find length of loop in a linked list
Palindrome Linked List
Intersection Point in Y-Shaped Linked List
Absolute sorting on a single linked list
Sum of two numbers represented by linked lists
Graph

Rotten Oranges
Alien Dictionary
Find the number of islands
Check a graph is Hamiltonian or not (Hamiltonian path)
Knight walk problem
Floyd Warshall Algorithm
Minimum Spanning Tree
PPATH - Prime Path Problem
Binary search

Book Allocation Problem (Allocate minimum number of pages)


Greedy Algorithms

Greedy Strategy to solve major algorithm problems


Job sequencing problem
Fractional knapsack problem
Rain Water Trapping Problem
Parenting Partnering Returns - Google CodeJam 2020 Qualification Round Problem
Solution
Dynamic Programming

0-1 Knapsack Algorithm


House Robber
Coin Change
Minimum Coin Change | Find minimum number of coins that make a given value
Word Break Problem
Friends pairing problem
Maximum Profit in Stock Buy and sell with at most K Transaction
Floyd Warshall Algorithm
Optimal Strategy for a Game
Highway billboard
Gold Mine Problem
Longest Increasing Subsequence
Minimum Number of coins to make the change
Get Minimum Squares
Count Numbers with unique digits
Maximum Sum Problem
Find number of times a string occurs as a subsequence
Number of Unique Paths
Minimum number of jumps
Rod Cutting
More Dynamic Programming Practice Problems

Matrix

Exit Point in a Matrix


Shortest Source to Destination Path
Gold Mine Problem
Print all possible path from source to destination
Matrix Probability
Matrix Exponentiation
Path in Matrix
Set Matrix Zeroes
Largest Square Sub Matrix of 1's in Given Binary Matrix
Recursion
Palindromic Array
Wine selling problem | Find the maximum profit from sale of wines
Minimum Coin Change | Find minimum number of coins that make a given value
Egg Dropping Problem
Maximum path sum in a binary tree
Minimum number of deletions to make a sorted sequence
Jumbled Strings
Count of divisible array
Maximum Calorie
Special Keyboard
Minimal moves to form a string
Total number of non-decreasing numbers with n digits using dynamic programming
Minimum Time to Display N Character
Knapsack with Duplicate Items
Longest Common Subsequence of three strings
Minimum steps to minimize n as per given condition
Count total number of Palindromic Subsequences
Adjacent are not allowed
Count number of binary strings without consecutive 1's
Longest Palindromic Substring
Count total number of Palindromic Substrings
More Recursion Practice Problems...

Number Theory

Sieve of Eratosthenes
Matrix Exponentiation
GCD Queries - Greatest Common Divisor Problem
PPATH - Prime Path Problem
Bitwise operators

Game of XOR
Puzzle

Prisoners and the poison


Combinatorics

Total number of non-decreasing numbers with n digits


Backtracking

String Matrix
Tug of War
Backtracking to find all subsets
Find out the sum-string
Power Set in Lexicographic order
Fill 8 numbers in a matrix
Partition a set into k subset with equal sum
Combinational sum problem
Combinational sum problem with repetition of digits
Match a pattern and String without using regular expressions
Warnsdorff's algorithm for Knight's tour problem
Partition to K Equal Sum Subsets
Print all possible path from source to destination
N-Queen Problem
Print all subsequences of a string
Count Unique Path
Iterative approach
Find the largest palindromic substring using O(1) space complexity
Trie Data Structure

Check the consistency of the numbers (Trie Data Structure Question)


Hash

Length of the largest subarray with equal number of 0s and 1s


Fencing Problem
Heap

Constructing the Array


Merge K Sorted Arrays
Sort K-Sorted Array
N Max Pair Combinations
Brute Force

Stock Span Problem


Rain Water Trapping Problem
Largest rectangle area in a histogram
Floor and Ceil Value
First and last occurrence of an element
Maximization of Quadruple
Find Minimum in Rotated Sorted Array
GCD Queries - Greatest Common Divisor Problem
PPATH - Prime Path Problem
N Max Pair Combinations
DFS

Matrix Probability
Segment Tree

Range Sum Queries


Lazy Propagation

Range Sum Queries


Implementation

Redundant Bracket
Rain Water Trapping Problem
Longest Prefix and Suffix
Fencing Problem
Constructing the Array
Merge K Sorted Arrays
Set Matrix Zeroes
GCD Queries - Greatest Common Divisor Problem
Google contests

Nesting Depth - Google CodeJam 2020 qualification round problem solution


Vestigium - Google CodeJam 2020 qualification round problem1 solution
Bus Routes Google Code Jam Round B Problem No. 2 Solution
Bike Tour Google Kick Start Round B Problem 1 Solution
Parenting Partnering Returns - Google CodeJam 2020 Qualification Round Problem
Solution
Competitive programming

How to overcome TLE in competitive programming?


Check the consistency of the numbers (Trie Data Structure Question)
Constructing the Array
Range Minimum Query
PPATH - Prime Path Problem

Level 1
Reverse words in a given string
Longest Common Prefix
Roman Number to Integer
Integer to Roman
Closest Strings
Divisible by 7
Encrypt the String – II
Equal point in a string of brackets
Isomorphic Strings
Check if two strings are k-anagrams or not
Panagram Checking
Minimum Deletions
Number of Distinct Subsequences
Check if string is rotated by two places

Level 2
Implement Atoi
Validate an IP address
License Key Formatting
Find largest word in dictionary
Equal 0,1, and 2
Find and replace in String
Add Binary Strings
Sum of two large numbers
Multiply two strings
Look and say Pattern
Minimum times A has to be repeated to make B a Substring
Excel Sheet – I
Form a Palindrome
Find the N-th character
Next higher palindromic number using the same set of digits
Length of longest prefix suffix
Longest K unique characters substring
Smallest window in string containing all characters
Longest Palindromic Subsequence
Longest substring without repeating characters
Substrings of length k with k-1 distinct elements
Count number of substrings
Interleaved Strings
Print Anagrams together
Rank the permutation
A Special Keyboard
Level 3
Restrictive Candy Crush
Edit Distance
Search Pattern (KMP-Algorithm)
Search Pattern (Rabin-Karp Algorithm)
Search Pattern (Z-algorithm)
Shortest Common Supersequence
Number of words with K maximum distinct vowels
Longest substring to form a Palindrome
Longest Valid Parenthesis
Distinct Palindromic Substrings
Related Articles:
Top 50 Array Coding Problems for Interviews
Top 50 Tree Coding Problems for Interviews
Top 50 Dynamic Programming Coding Problems for Interviews

Like
0
Previous
Difference between message queues and mailboxes
Next
Difference between LAMP stack and LEMP stack?
RECOMMENDED ARTICLES
Page :
1
2
3
MakeMyTrip Interview Experience | Set 6 (Online Coding)
23, Aug 15
TCS National Qualifier 2 Coding Question.
03, Sep 18
Count characters of a string which when removed individually makes the string equal
to another string
09, Jun 21
String matching where one string contains wildcard characters
11, Apr 13
Check if a string can become empty by recursively deleting a given sub-string
08, Nov 16
Sort a string according to the order defined by another string
01, Dec 16
Check if a string can be obtained by rotating another string 2 places
16, Mar 17
String slicing in Python to check if a string can become empty by recursive
deletion
11, Nov 17
Find the character in first string that is present at minimum index in second
string
07, Jul 17
Check if a given string is sum-string
25, Aug 17
Lexicographically smallest string whose hamming distance from given string is
exactly K
17, Oct 17
Decode a median string to the original string
01, Nov 17
String slicing in Python to rotate a string
23, Nov 17
Check whether second string can be formed from characters of first string
13, Dec 17
Count subsequences in first string which are anagrams of the second string
28, Dec 17
Create a new string by alternately combining the characters of two halves of the
string in reverse
16, Jan 18
Convert the string into palindrome string by changing only one character
22, Jan 18
Find if a string starts and ends with another given string
23, Feb 18
Minimal moves to form a string by adding characters or appending string itself
26, Mar 18
Convert Hexadecimal value String to ASCII value String
22, May 18
Lexicographically smallest string formed by appending a character from the first K
characters of a given string
20, Jul 18
Minimum length of string having all permutation of given string.
07, Oct 18
Minimum changes required to make first string substring of second string
17, Oct 18
Check if a string contains a palindromic sub-string of even length
10, Nov 18
Article Contributed By :
https://media.geeksforgeeks.org/auth/avatar.png
GeeksforGeeks
Vote for difficulty
Current difficulty : Medium
Easy
Normal
Medium
Hard
Expert
Article Tags :
Strings
Practice Tags :
Strings
Improve Article
Report Issue
Writing code in comment? Please use ide.geeksforgeeks.org, generate link and share
the link here.

Load Comments

WHAT'S NEW
DSA Live Classes for Working Professionals
DSA Live Classes for Working Professionals
View Details
Competitive Programming Live Classes for Students
Competitive Programming Live Classes for Students
View Details
Complete Interview Preparation Course
Complete Interview Preparation Course
View Details

MOST POPULAR IN STRINGS


How to split a string in C/C++, Python and Java?
Convert Infix To Prefix Notation
How to Append a Character to a String in C
Vigenère Cipher
Given a sequence of words, print all anagrams together | Set 1

MORE RELATED ARTICLES IN STRINGS


Return maximum occurring character in an input string
Count words in a given string
Convert character array to string in C++
Split a sentence into words in C++
Count occurrences of a word in string

You might also like