Tredence
20+ Sandoz Interview Questions and Answers
Q1. Palindrome String Validation
Determine if a given string 'S' is a palindrome, considering only alphanumeric characters and ignoring spaces and symbols.
Note:
The string 'S' should be evaluated in a case-insensi...read more
Q2. Pair Sum Problem Statement
You are given an integer array 'ARR' of size 'N' and an integer 'S'. Your task is to find and return a list of all pairs of elements where each sum of a pair equals 'S'.
Note:
Each pa...read more
Q3. Find First Repeated Character in a String
Given a string 'STR' composed of lowercase English letters, identify the character that repeats first in terms of its initial occurrence.
Example:
Input:
STR = "abccba"...read more
Q4. Reverse Linked List Problem Statement
Given a singly linked list of integers, return the head of the reversed linked list.
Example:
Initial linked list: 1 -> 2 -> 3 -> 4 -> NULL
Reversed linked list: 4 -> 3 -> 2...read more
Q5. public static void getsum(int a,int b){System.out.println("a b method");}public static void getsum(int a,int b,int c){System.out.println("a b c method");}public static void getsum(int a,int ...b){System.out.pri...
read moreThe question is about method overloading in Java.
Method overloading allows multiple methods with the same name but different parameters.
The method to be called is determined at compile-time based on the arguments passed.
In the given code, there are three overloaded methods with the same name 'getsum'.
The first method takes two integers as arguments.
The second method takes three integers as arguments.
The third method takes one integer followed by a variable number of integers ...read more
Q6. output of this program public static int floating(int x){ return x*floating(x-1); } public static void main(String[] args){ floating(10); }
The program will result in a StackOverflowError due to infinite recursion.
The 'floating' method is recursively calling itself without a base case to stop the recursion.
Each recursive call multiplies the input parameter by the result of the recursive call with a decremented parameter.
This will continue indefinitely until the stack overflows and an error is thrown.
Q7. what is front controller from context in spring mvc?
Front controller is a design pattern used in Spring MVC to handle incoming requests and route them to appropriate handlers.
Front controller acts as a central point of control for handling requests in Spring MVC.
It receives all incoming requests and delegates them to appropriate handlers called controllers.
Front controller provides a consistent way to handle requests and perform common tasks like authentication, logging, etc.
In Spring MVC, the DispatcherServlet acts as the fro...read more
Q9. what is the output of this int i=0; int j=10;do{ if(i++ < --j){ } }while(i
The output of the code is 9.
The code initializes i as 0 and j as 10.
Inside the do-while loop, i is incremented by 1 and j is decremented by 1.
The loop continues until i becomes greater than or equal to j.
Since i is incremented before the comparison and j is decremented before the comparison, the loop runs 9 times.
Therefore, the output is 9.
Q11. write the annotation for controller?
An annotation for controller in software engineering.
The annotation for controller is used to define the class as a controller in a software application.
It is typically used in frameworks like Spring MVC or ASP.NET MVC.
The annotation helps in mapping the incoming requests to the appropriate controller methods.
It can also be used to specify the URL path for the controller.
Example: @Controller in Spring MVC, [ApiController] in ASP.NET MVC
Q12. change all ul element to blue background color using jquery
Use jQuery to change the background color of all ul elements to blue.
Use the jQuery selector to select all ul elements
Use the css() method to change the background color to blue
Q14. output of this var arr=[1,2,3,4,5] arr.push(6) arr.unshift(1) arr.pop() arr.shift()
The output of the given code is [1, 2, 3, 4, 5, 6].
The 'push' method adds an element to the end of the array.
The 'unshift' method adds an element to the beginning of the array.
The 'pop' method removes the last element from the array.
The 'shift' method removes the first element from the array.
Q15. change first li element to yellow background color using jquery
Use jQuery to change the background color of the first li element to yellow.
Use the :first-child selector to select the first li element
Use the css() method to change the background color to yellow
Q17. write the annotation for request mapping?
The annotation for request mapping is used to map HTTP requests to specific methods in a controller class.
The annotation is @RequestMapping
It can be used at the class level to specify a common base URL for all methods in the class
It can also be used at the method level to specify the URL path and HTTP method for a specific method
Additional attributes can be used to further customize the mapping, such as specifying request parameters or headers
Example: @RequestMapping(value = ...read more
Q18. what are the uses of final in java
The 'final' keyword in Java is used to declare constants, prevent method overriding, and ensure thread safety.
Final variables cannot be reassigned once initialized
Final methods cannot be overridden by subclasses
Final classes cannot be extended by other classes
Final parameters ensure that they cannot be modified within a method
Final fields can be used to achieve thread safety
Q24. write the css box model?
The CSS box model describes the layout and sizing of elements on a web page.
The box model consists of content, padding, border, and margin.
Content refers to the actual content of the element, such as text or images.
Padding is the space between the content and the border.
Border is a line that surrounds the padding and content.
Margin is the space outside the border, separating the element from other elements.
The width and height of an element are calculated by adding the conten...read more
Q25. select all div using jquery
Select all div using jQuery
Use the jQuery selector $('div') to select all div elements
This will return a jQuery object containing all the selected div elements
You can then perform operations on the selected div elements using jQuery methods
Top Software Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month