Tip 1 : Revise all the basic/top algos and Dsa questions atleast you should solve 200-250questions
Tip 2 : Should be familiar with java8/11 features like stream function or lambda function.
Tip 3 : In sql you must know joints and how to use them.
Tip 1 : Highlight your skill and discuss same during interview
Tip 2 : Do not put false things on resume
Tip 3 : Resume should be 1 page and with good spaces so that interviewer can easily go through.
You have 24 hrs to attempt the test, so per your flexibility you can try. Timing was sufficient as per question level, Question was described so well and easily understandable.



Let ‘ARR’ be: [3, 2, 1]
We can pick the whole array as a subarray and reverse it to get the sorted array [1, 2, 3].
Image Editors: Cloning ShapeS
Most image editors can retain the properties of a drawn shape, which makes the copy-paste operations easier. In, this challenge, implement the Shape class per the following constructor and methods:
• The constructor Shape(String type, String color).
• The method String getType to return the shape type.
• The method void setType(String type) to update the Shape type.
• The method String getColor( to return the shape color.
• The method void setColor(String color) to update the Shape color.
• The method Shape cloneShape() to return the clone of the shape.
The locked stub code in the editor validates the correctness of the Shape class implementation by performing the following operations on the shapes initially drawn on the image editor.
• CS shapeld. This operation creates the clone of the Shape.
• UT shapeld shapeNewType: This operation updates the shape type.
• UC shapeld shapeNewColor. This operation updates the shape color.
After performing all the operations, the locked stub code prints the type and color of each shape.
Constraints
• 1 ≤ numberOfShapes = 50
• 1 ≤ numberOfOperations ≤ 500
Input Format For Custom Testing
The first line contains the value of
numberOfShapes, the total number of shapes initially drawn in the image editor.
Each of the next numberOfShapes lines contains two space-separated strings, the shape's type and color.
The next line contains the value of numberOfOperations, the total number of operations performed on the drawn shapes.
Each of the next numberOfOperations lines contains one of the three operations listed above.
STDIN
Function
3
number0fShapes =
3
Circle Red
>
color = 'Red'
type = 'circle',
Square Blue
color = 'Blue'
type = "Square',
Circle Yellow
color = 'Yellow'
type = 'Circle',
6
number0fOperations
= 6
CS 1
)
operation = clone
shape ID 1
UT 1 Square
operation = update
shape ID 1 to 'Square'
Sample Output 0
Square Yellow
Square Blue
Circle Green
Circle Red
Circle Red
Circle Red
public class Solution {
private static final Scanner INPUT_ READER = new Scanner (System.in);
pubtic static void main(Stringl args) I
List‹Shape> shapes = new ArrayList‹>0:
int numberOfShapes = Integer.parseInt (INPUT_READER.nextLine ()) ;
while (numberOfShapes-- > 0) {
stringli shape = INPUT_READER. nextLine() .split (" ");
shapes. add (new Shape (shape [0], shape [1])) ;
int numberOfOperations = Integer.parseInt (INPUT_READER. nextLine ()) ;
while (numberOfOperations=- > 0) {
String[] operation = INPUT_READER.nextLine() •split(" ");
Shape shape = shapes. get (Integer.parseInt (operation [11) - 1);
if (operation[0].equals ("CS")) {
Shape clonedShape = shape.cloneShape () ;
if (clonedShape == shape) {
shapes.add (new Shape ("Bad-type", "No-color"));
]shapes. add (clonedShape) ;
}else if (operation [01 ,equals ("UT")) {
shape.setType(operation [21);
} else if (operation[0].equals ("UC")) {
shape.setColor (operation [2]);
}
Interview starts with introduction then interviewer asked me about OOPs concept and java 8 questions then he gave me to solve dsa question, while discussion over Dsa question we moved to spring boot where he asked me about basic tags and rest controller then in next steps he checked my knowledge about messaging queue and in last we had a good discussion about sql



Conditions for valid parentheses:
1. All open brackets must be closed by the closing brackets.
2. Open brackets must be closed in the correct order.
()()()() is a valid parentheses.
)()()( is not a valid parentheses.
Declare a character stack (say temp).
Now traverse the string exp.
If the current character is a starting bracket ( ‘(‘ or ‘{‘ or ‘[‘ ) then push it to stack.
If the current character is a closing bracket ( ‘)’ or ‘}’ or ‘]’ ) then pop from stack and if the popped character is the matching starting bracket then fine.
Else brackets are Not Balanced.
After complete traversal, if there is some starting bracket left in stack then Not balanced, else Balanced.
This was easy then the previous round i was asked about java 8 questions then we had discussion over springboot and oops concept and in end he asked me some managerial questions.
Consider following Java program:
class func {
public static void main(String args[])
{
System.out.println("Hello World");
}
}
Hello World
Explanation:
1)public: It is an access specifier which allows the JVM(Java Virtual Machine) to access the main method from anywhere.
2)static: static keyword allows the JVM to access the main method without any instance(object).
3)void: It specifies that the main method doesn’t return anything.
4)main: name of the method(function) configured in JVM.
5)String args[]: Command line arguments.
Now, if we replace ‘public’ with ‘private’ in “public static void main”, the above code becomes:
class func {
private static void main(String args[])
{
System.out.println("Hello World");
}
}
Explanation:
The above code will be compiled successfully, but will throw a runtime error as follows:
Error: Main method not found in class func, please define the main method as:
public static void main(String[] args)
or a JavaFX application class must be defined.
This was client round and it was kind of discussion over skills and had discussion about the oops, java 8, exceptional handling, springboot, AWS quicksight and Sql.



Given 'N' : 5 (number of packets) and 'M' : 3 (number of students)

And chocolates in each packet is : {8, 11, 7, 15, 2}
All possible way to distribute 5 packets of chocolates among 3 students are -
( 8,15, 7 ) difference of maximum-minimum is ‘15 - 7’ = ‘8’
( 8, 15, 2 ) difference of maximum-minimum is ‘15 - 2’ = ‘13’
( 8, 15, 11 ) difference of maximum-minimum is ‘15 - 8’ = ‘7’
( 8, 7, 2 ) difference of maximum-minimum is ‘8 - 2’ = ‘6’
( 8, 7, 11 ) difference of maximum-minimum is ‘11 - 7’ = ‘4’
( 8, 2, 11 ) difference of maximum-minimum is ‘11 - 2’ = ‘9’
( 15, 7, 2 ) difference of maximum-minimum is ‘15 - 2’ = 13’
( 15, 7, 11 ) difference of maximum-minimum is ‘15 - 7’ = ‘8’
( 15, 2, 11 ) difference of maximum-minimum is ‘15 - 2’ = ‘13’
( 7, 2, 11 ) difference of maximum-minimum is ‘11 - 2’ = ‘9’
Hence there are 10 possible ways to distribute ‘5’ packets of chocolate among the ‘3’ students and difference of combination (8, 7, 11) is ‘maximum - minimum’ = ‘11 - 7’ = ‘4’ is minimum in all of the above.
Follow the steps mentioned below to implement the approach:
Initially sort the given array. And declare a variable to store the minimum difference, and initialize it to INT_MAX. Let the variable be min_diff.
Find the subarray of size m such that the difference between the last (maximum in case of sorted) and first (minimum in case of sorted) elements of the subarray is minimum.
We will run a loop from 0 to (n-m), where n is the size of the given array and m is the size of the subarray.
We will calculate the maximum difference with the subarray and store it in diff = arr[highest index] – arr[lowest index]
Whenever we get a diff less than the min_diff, we will update the min_diff with diff.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
How do you remove whitespace from the start of a string?