1.
Practice it java
Remove a duplicate characters from array
Sample input : [‘a’, ‘b’,’c’,’b’, ‘a’]
Output : [‘c’]
2. Basic Java concepts
Create a Interface “Vehicle” and it should have five methods
1.to return a color
2. To return a Vehicle number
3.To return a Vehicle name
4. To return a type (car or bike )
5. Boolean method (light LMvs or HMVs )
Interface should be implemented by Car class and Bike class
Car class only implement first 3 of this methods
Bike class should implement all of this methods
Create multiple cars and bikes
Add Cars in ArrayList
Add Bikes in LinkedList
In Your List should not contain duplicate cars and vehicle based on vehicle number
3. Java object oriented programing
creates a class hierarchy for Student of a college. The base class should be
Student, with subclasses Professor, Admin, and Principal. Each subclass should have
properties such as name, address, salary, and job title. Implement methods for
calculating bonuses, generating performance reports, and managing projects.
Principal’s Bonus: $12000.0
Professor’s Bonus: $7200.0
Admin’s Bonus: $9120.0
Performance report for Principal Raja : Excellent
Performance report for Professor Babu : Good
Performance report for Admin kumar : Excellent
Principal Raja is Head of the college.
Professor Babu is teaching staff of the college
Admin Kumar is non teaching staff of the college
4. Advance Java programing
Keep multiple files in a directory (.txt, .pdf, .mp3, .mp4)
Read the files and write a file name in Excel sheet
Sheet 1 should contains only text file name
Sheet2 should contains only .pdf file name
etc..
5. Java Algorithms
Count the number of word occurrence in the string
Sample input : “He is a good Boy and He is a smart boy”
Sample output : He 2 times
Is 2 times
A 1 time
Boy 2 times
Etc..
Data structure
You have three stacks of bottles where each bottle has the same diameter, but they may vary in height. You
can change the height of a stack by removing and discarding its topmost bottle any number of times.
Find the maximum possible height of the stacks such that all of the stacks are exactly the same height. This
means you must remove zero or more bottles from the top of zero or more of the three stacks until they are
all the same height, then return the height.
STDIN Function
----- --------
534 h1[] size n1 = 5, h2[] size n2 = 3, h3[] size n3 = 4
32111 h1 = [3, 2, 1, 1, 1]
432 h2 = [4, 3, 2]
1141 h3 = [1, 1, 4, 1]
Sample output
Initially, the stacks look like this:
To equalize thier heights, remove the first cylinder from stacks 1 and 2 , and then remove the top two
cylinders from stack 3(shown below).
The stack heights are reduced as follows:
1. 8-3 =5
2. 9-4 =5
3. 7-1-1=5
All three stacks now have height = 5 , the value to return.
6. Spring and Spring boot
Create CRUD operation for Hotel Application using REST, JPA, Hibernate, any DB, MySql
Write Junit wherever applicable
7. Micro service
7.1. Create user registration application for customer and hotel admin
When you login through hotel admin interact with Hotel application and add your
Dishes as menu
When you login as customer you can view only hotel list and hotel menus
7.2 create a order application
You can login with any type of user either customer or admin
And you can order any food from the hotel application
When you interact from user application/ order application you should interact using with jwt token
Only registration page/login should be accessible for all user
All application should be created as executable jar
REST,JPA, Hibernate, any DB, MySql, Maven, Junit
Each application should be run in 2 jars
Your Hotel application log should have the request details (which instance is hitting the Hotel application)
When one hotel instance is down all the request should reach to the another hotel running instance
8. Program Challenge
You are given two arrays
a1,a2,..an
and
b1, b2, …..bn
. In each step, you can set
ai = ai -bi
if
ai > bi
. Determine the minimum number of steps that are required to make all
a's equal.
Input format
● First line:
● n
● Second line:
● a1,a2,..an
● Third line:
● b1, b2, …..bn
● Output format
● Print the minimum number of steps that are required to make all
● a's equal. If it is not possible, then print -1.
Sample input
25 64 3
Sample output
-1
Sample Input
5 7 10 5 15
22135
Sample Output
—----------------------
9. Program Challenge
You are required to enter a word that consists of
x and y
that denote the number of Zs and Os respectively. The input word is considered similar to word zoo if
2×x=y
Determine if the entered word is similar to word zoo.
For example, words such as zzoooo and zzzoooooo are similar to word zoo but not the words such as zzooo
and zzzooooo.
Input format
● First line: A word that starts with several Zs and continues by several Os.
Note: The maximum length of this word must be
● 20
Output format
Print Yes if the input word can be considered as the string zoo otherwise, print No.
Sample Input
zzzoooooo
Sample Output
Yes
10: Program Challenge
You have been given a String S consisting of uppercase and lowercase English alphabets. You need to change
the case of each alphabet in this String. That is, all the uppercase letters should be converted to lowercase
and all the lowercase letters should be converted to uppercase. You need to then print the resultant String to
output.
Input Format
The first and only line of input contains the String S
Output Format
Print the resultant String on a single line.
Sample Input
abcdE
Sample Output
ABCDe
11: Program Challenge
You are given a grid of size
N*N
that has the following specifications:
● Each cell in the grid contains either a policeman or a thief.
● A policeman can only catch a thief if both of them are in the same row.
● Each policeman can only catch one thief.
● A policeman cannot catch a thief who is more than K units away from the policeman.
Write a program to find the maximum number of thieves that can be caught in the grid
Input format
● First line: T (number of test cases)
For each test case
● First line: Two space-separated integers N and K
● Next N lines: N space-separated characters (denoting each cell in the grid)
Output format
For each test case, print the maximum number of thieves that can be caught in the grid.
Sample Input
31
PTP
TPT
TTP
Sample Output
3
Explanation
Total Thieves = 5
Number of thieves reachable by policemen in Row 1 = 1
Number of thieves reachable by policemen in Row 2 = 2
Number of thieves reachable by policemen in Row 3 = 1
However, one policeman can catch at most 1 thief. Hence, in Row 2, only 1 thief is catchable.
Therefore, the 3 thieves can be caught.