Add office photos
Employer?
Claim Account for FREE

Tredence

3.6
based on 473 Reviews
Video summary
Filter interviews by

20+ Gsa Industries Interview Questions and Answers

Updated 5 Feb 2024
Popular Designations

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
Ans.

Validate if a given string is a palindrome after removing special characters, spaces, and converting to lowercase.

  • Remove special characters and spaces from the input string

  • Convert the string to lowercase

  • Check if the modified string is equal to its reverse to determine if it's a palindrome

Add your answer

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

Ans.

Given an array and a target sum, find pairs of elements that add up to the target sum.

  • Iterate through the array and for each element, check if the complement (target sum - current element) is present in a hash set.

  • If the complement is found, add the pair to the result list.

  • Sort the pairs based on the first element, and if the first elements are equal, sort based on the second element.

Add your answer

Q3. 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
Ans.

Reverse a singly linked list of integers and return the head of the reversed linked list.

  • Iterate through the linked list and reverse the pointers to point to the previous node instead of the next node.

  • Use three pointers to keep track of the current, previous, and next nodes while reversing the linked list.

  • Update the head of the reversed linked list as the last node encountered during the reversal process.

Add your answer

Q4. 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
Ans.

Find the first repeated character in a given string of lowercase English letters.

  • Iterate through the string and keep track of characters seen so far

  • Return the first character that repeats, if none, return '%'

  • Use a hash set or array to store characters seen

Add your answer
Discover Gsa Industries interview dos and don'ts from real experiences

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 more
Ans.

The 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

Add your answer
Q6. You were given CSS code and asked to debug it to make the functionality work. Can you describe the process you followed and the issues you encountered?
Ans.

I followed a systematic process to debug CSS code and resolve functionality issues.

  • Reviewed the CSS code to identify any syntax errors or typos

  • Checked for any conflicting styles that may be overriding the desired functionality

  • Used browser developer tools to inspect elements and troubleshoot layout issues

  • Tested different scenarios to pinpoint the exact cause of the problem

  • Made necessary adjustments to the CSS code to fix the functionality

Add your answer
Are these interview questions helpful?

Q7. output of this program public static int floating(int x){ return x*floating(x-1); } public static void main(String[] args){ floating(10); }

Ans.

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.

Add your answer

Q8. what is front controller from context in spring mvc?

Ans.

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

Add your answer
Share interview questions and help millions of jobseekers 🌟
Q9. You have a puzzle involving 4 liters of water. Can you describe the details of this puzzle?
Ans.

A puzzle involving 4 liters of water where you need to measure specific quantities using only a 3-liter and a 5-liter jug.

  • You have two jugs - one holds 3 liters and the other holds 5 liters.

  • The goal is to measure out exactly 4 liters of water using only these two jugs.

  • You can fill the jugs, empty them, and transfer water between them to achieve the desired quantity.

Add your answer
Q10. How can you change the background color of all items in JavaScript?
Ans.

You can change the background color of all items in JavaScript by selecting all elements and setting their background color property.

  • Select all elements using document.querySelectorAll()

  • Loop through the selected elements and set their style.backgroundColor property

  • Example: document.querySelectorAll('.item').forEach(item => item.style.backgroundColor = 'blue');

Add your answer

Q11. what is the output of this int i=0; int j=10;do{ if(i++ < --j){ } }while(i

Ans.

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.

View 1 answer
Q12. What is the annotation for request mapping in Java?
Ans.

The annotation for request mapping in Java is @RequestMapping.

  • @RequestMapping annotation is used to map web requests to specific handler methods in Spring MVC.

  • It can be applied at class level or method level to specify the URL path that the controller will handle.

  • You can also specify HTTP request methods, headers, parameters, and more using @RequestMapping.

Add your answer
Q13. What is the annotation used for a controller in Java?
Ans.

The annotation used for a controller in Java is @RestController.

  • Used to define a class as a controller in Spring MVC

  • Automatically serializes return objects into JSON/XML responses

  • Equivalent to @Controller + @ResponseBody annotations

Add your answer

Q14. write the annotation for controller?

Ans.

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

Add your answer

Q15. change all ul element to blue background color using jquery

Ans.

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

Add your answer
Q16. How do you select all div elements using jQuery?
Ans.

To select all div elements using jQuery, use the selector $('div').

  • Use the jQuery selector $('div') to select all div elements on the page.

  • You can also use the find() method to select div elements within a specific parent element.

  • To perform actions on the selected div elements, use jQuery methods like css(), text(), or addClass().

Add your answer
Q17. What are the uses of the final keyword in Java?
Ans.

The final keyword in Java is used to define constants, prevent method overriding, and make a class immutable.

  • Final variables cannot be reassigned once initialized

  • Final methods cannot be overridden in subclasses

  • Final classes cannot be extended

Add your answer
Q18. What is the Front Controller in Spring MVC?
Ans.

Front Controller in Spring MVC is a design pattern that handles all requests and acts as a central point of control.

  • Front Controller is a servlet in Spring MVC that receives all requests and then dispatches them to the appropriate handlers.

  • It helps in centralizing request handling logic, improving code organization and reducing duplication.

  • Front Controller can perform tasks like authentication, logging, exception handling, and more before passing the request to the actual han...read more

Add your answer

Q19. output of this var arr=[1,2,3,4,5] arr.push(6) arr.unshift(1) arr.pop() arr.shift()

Ans.

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.

Add your answer

Q20. change first li element to yellow background color using jquery

Ans.

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

Add your answer

Q21. write the annotation for request mapping?

Ans.

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

Add your answer

Q22. what are the uses of final in java

Ans.

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

Add your answer
Q23. What is the CSS box model?
Ans.

The CSS box model is a design and layout concept that defines the structure and sizing of elements on a web page.

  • It consists of content, padding, border, and margin around an element.

  • Content area is where text and images are displayed.

  • Padding is the space between the content and the border.

  • Border is the line that goes around the padding and content.

  • Margin is the space outside the border.

  • Example: div { width: 200px; padding: 20px; border: 1px solid black; margin: 10px; }

Add your answer

Q24. write the css box model?

Ans.

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

Add your answer

Q25. select all div using jquery

Ans.

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

Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Software Engineer Interview Questions from Similar Companies

3.8
 • 45 Interview Questions
2.7
 • 40 Interview Questions
3.7
 • 22 Interview Questions
3.8
 • 21 Interview Questions
3.8
 • 10 Interview Questions
View all
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
75 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter