Add office photos
Engaged Employer

Wipro

3.7
based on 50.8k Reviews
Filter interviews by

30+ NSK Interview Questions and Answers

Updated 28 Aug 2024
Popular Designations

Q1. Tell me some keywords to make a thread safe program in java ?

Ans.

Keywords for thread safe program in Java

  • Synchronization using synchronized keyword

  • Using volatile keyword for shared variables

  • Using atomic classes for thread safe operations

  • Using thread safe collections like ConcurrentHashMap

  • Using locks and semaphores for synchronization

  • Avoiding shared mutable state

  • Using immutable objects

  • Using thread local variables

View 3 more answers

Q2. How to start spring boot application even though a class having error

Ans.

To start Spring Boot app with class error, disable strict classpath checking.

  • Add 'spring.main.lazy-initialization=true' to application.properties.

  • Disable strict classpath checking by adding 'spring.main.allow-bean-definition-overriding=true'.

  • Use 'spring.main.banner-mode=off' to disable banner.

  • Use 'spring.main.web-environment=false' to disable web environment.

  • Use 'spring.main.headless=true' to enable headless mode.

View 1 answer

Q3. What is the difference between JDK, JRE, and JVM?

Ans.

JDK is a development kit, JRE is a runtime environment, and JVM is a virtual machine for running Java programs.

  • JDK (Java Development Kit) is a software development kit used for developing Java applications. It includes JRE, compiler, debugger, and other tools.

  • JRE (Java Runtime Environment) is a software package that provides the libraries, Java Virtual Machine (JVM), and other components necessary for running Java applications.

  • JVM (Java Virtual Machine) is an abstract machine...read more

View 1 answer

Q4. What do you understand by Java virtual machine?

Ans.

Java virtual machine (JVM) is a virtual machine that enables a computer to run Java programs.

  • JVM is an abstract machine that provides a runtime environment for Java bytecode to be executed.

  • It is responsible for converting Java bytecode into machine code that can be understood by the computer's operating system.

  • JVM is platform-independent, allowing Java programs to run on any device or operating system that has a JVM implementation.

  • It manages memory, handles garbage collection...read more

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

Q5. When you will received class modification exception.

Ans.

Class modification exception occurs when a class is modified after it has been loaded by the JVM.

  • This exception is thrown when a class is modified and then reloaded by the JVM.

  • It can occur when a class is modified during runtime or when a new version of a class is loaded.

  • This exception can be avoided by using a class loader that isolates the classes from each other.

  • An example of this exception is when a method is added to a class and then the class is reloaded by the JVM.

View 1 answer

Q6. what is the use of RequestBody Annatotion in spring

Ans.

RequestBody annotation is used to bind the HTTP request body to a method parameter in Spring.

  • Used in Spring MVC to handle POST requests

  • Used to map the request body to a Java object

  • Can be used with other annotations like @PostMapping

  • Can be used to validate the request body using @Valid annotation

Add your answer
Are these interview questions helpful?

Q7. Who is the father of java ?

Ans.

James Gosling is considered the father of Java programming language.

  • James Gosling, a Canadian computer scientist, is credited with creating the Java programming language in the early 1990s.

  • He developed Java while working at Sun Microsystems, now owned by Oracle.

  • Java was officially released by Sun Microsystems in 1995 and has since become one of the most popular programming languages in the world.

View 2 more answers

Q8. What is JIT compiler?

Ans.

JIT compiler stands for Just-In-Time compiler, which compiles Java bytecode into native machine code at runtime for improved performance.

  • JIT compiler is part of the Java Virtual Machine (JVM) and helps in optimizing the performance of Java applications.

  • It compiles Java bytecode into native machine code on-the-fly, right before executing it.

  • JIT compiler identifies hot spots in the code (frequently executed portions) and optimizes them for better performance.

  • Examples of JIT com...read more

Add your answer
Share interview questions and help millions of jobseekers šŸŒŸ

Q9. How to create method over riding and how to use in Java application.

Ans.

Method overriding in Java allows a subclass to provide a specific implementation of a method that is already provided by its superclass.

  • Create a subclass that extends a superclass with a method to be overridden

  • Define a method in the subclass with the same signature as the superclass method

  • Use the @Override annotation to indicate that the method is intended to override a superclass method

  • Call the superclass method using the super keyword within the overridden method

Add your answer

Q10. How to make a class immutable SOLID principles factory designer pattern

Ans.

To make a class immutable, use final keyword, private fields, no setters, and defensive copying.

  • Use final keyword to make class unextendable

  • Use private fields to prevent direct access

  • No setters to prevent modification

  • Defensive copying to prevent modification of mutable objects

  • SOLID principles and factory design pattern can be used to create immutable objects

  • Example: String class in Java is immutable

Add your answer

Q11. Where branch in Wipro BPS?

Ans.

Wipro BPS has multiple branches across India and globally.

  • Wipro BPS has branches in major cities like Bangalore, Chennai, Mumbai, Pune, Hyderabad, etc.

  • They also have branches in countries like the USA, UK, Australia, etc.

  • The exact branch location for a Java Developer role may depend on the project and client requirements.

Add your answer

Q12. Why use in java to Javascript

Ans.

Java and JavaScript are two different programming languages with different use cases.

  • Java is used for building server-side applications, Android apps, and enterprise software.

  • JavaScript is used for building interactive web applications and front-end development.

  • Java is a compiled language while JavaScript is an interpreted language.

  • Java is statically typed while JavaScript is dynamically typed.

  • Java code runs on the Java Virtual Machine (JVM) while JavaScript code runs on web ...read more

Add your answer

Q13. Method over ridingi s a wrapper class to mainclass.. is easily understand the topic.

Ans.

Method overriding is a way to provide a specific implementation of a method in a subclass that is already provided by its superclass.

  • Method overriding allows a subclass to provide a specific implementation of a method that is already defined in its superclass.

  • The method in the subclass must have the same name, return type, and parameters as the method in the superclass to override it.

  • Method overriding is used to achieve runtime polymorphism in Java.

  • Example: class Animal { voi...read more

Add your answer

Q14. what is javascript and c++ and why its imp

Ans.

JavaScript and C++ are programming languages used for web development and system programming respectively.

  • JavaScript is a scripting language used for front-end web development.

  • C++ is a high-level programming language used for system programming and software development.

  • JavaScript is essential for creating interactive web pages and dynamic content.

  • C++ is important for developing high-performance applications and operating systems.

Add your answer

Q15. Explain Jdk, jre?

Ans.

JDK stands for Java Development Kit, which is a software development kit used for developing Java applications. JRE stands for Java Runtime Environment, which is required to run Java applications.

  • JDK includes JRE along with development tools such as compiler, debugger, etc.

  • JRE includes JVM (Java Virtual Machine) and libraries necessary for running Java applications.

  • Developers use JDK to write, compile, and debug Java programs, while end-users only need JRE to run Java applica...read more

View 1 answer

Q16. Difference between final finalise and finally keywords

Ans.

final, finalize, and finally are keywords in Java with different purposes.

  • final is used to declare a constant value that cannot be modified

  • finalize is a method used for garbage collection

  • finally is a block used in exception handling to ensure a piece of code is always executed

Add your answer

Q17. Write program to find second largest number in unsorted array

Ans.

Program to find the second largest number in an unsorted array

  • Iterate through the array and keep track of the largest and second largest numbers

  • Initialize the largest and second largest variables with the first two elements of the array

  • Compare each element with the largest and second largest variables and update them if necessary

  • Return the second largest number

Add your answer

Q18. what is difference between spring and spring boot.

Ans.

Spring is a framework for building Java applications, while Spring Boot is a tool that simplifies the setup and configuration of Spring applications.

  • Spring is a comprehensive framework that provides support for various functionalities like dependency injection, aspect-oriented programming, and more.

  • Spring Boot is an opinionated tool that aims to simplify the setup and configuration of Spring applications by providing defaults and auto-configuration.

  • Spring Boot includes embedd...read more

Add your answer

Q19. spring boot annotations and difference between @Component and @Bean

Ans.

Spring Boot annotations @Component and @Bean have different purposes. @Component is used for auto-detection and instantiation of beans, while @Bean is used to explicitly define a bean.

  • Use @Component to automatically detect and instantiate beans based on classpath scanning.

  • Use @Bean to explicitly define a bean in a configuration class.

  • @Component is a generic stereotype annotation while @Bean is a method-level annotation.

  • @Component is used for classes, while @Bean is used for m...read more

Add your answer

Q20. Types of joins in sql

Ans.

Types of joins in SQL

  • Inner join: returns only the matching rows from both tables

  • Left join: returns all rows from the left table and matching rows from the right table

  • Right join: returns all rows from the right table and matching rows from the left table

  • Full outer join: returns all rows from both tables

  • Cross join: returns the Cartesian product of both tables

Add your answer

Q21. what is platform independence language

Ans.

Platform independence language refers to a programming language that can run on any platform without needing to be recompiled.

  • Java is a platform independence language because it uses the Java Virtual Machine (JVM) to run on any platform.

  • Platform independence allows Java programs to be written once and run anywhere, saving time and effort for developers.

  • Other examples of platform independence languages include Python and Ruby.

Add your answer

Q22. what is java and why its imp

Ans.

Java is a high-level programming language known for its portability, security, and versatility.

  • Java is platform-independent, meaning it can run on any device with a Java Virtual Machine (JVM).

  • It is object-oriented, allowing for modular and reusable code.

  • Java is widely used in web development, mobile applications, enterprise software, and more.

  • Its strong security features make it a popular choice for building secure applications.

  • Java has a large standard library and active com...read more

Add your answer

Q23. Annoatation of Spring REST

Ans.

Spring REST annotations are used to simplify the development of RESTful web services in Spring framework.

  • Annotations like @RestController, @RequestMapping, @GetMapping, @PostMapping, @PutMapping, @DeleteMapping are commonly used in Spring REST.

  • These annotations help in mapping HTTP requests to specific handler methods, defining request mappings, and handling request parameters.

  • For example, @GetMapping("/users") will map a GET request to /users endpoint to a specific method in...read more

Add your answer

Q24. complete Spring MVC Flow .

Ans.

Spring MVC Flow involves DispatcherServlet, HandlerMapping, Controller, Model, ViewResolver, and View.

  • Client sends a request to DispatcherServlet.

  • DispatcherServlet consults HandlerMapping to determine the appropriate Controller.

  • Controller processes the request, interacts with Model, and returns a logical view name.

  • DispatcherServlet consults ViewResolver to map the logical view name to an actual View.

  • View renders the response and sends it back to the client.

Add your answer

Q25. Difference between primary and unique key

Ans.

Primary key uniquely identifies each record in a table, while unique key ensures that all values in a column are different.

  • Primary key does not allow NULL values, while unique key allows one NULL value.

  • A table can have only one primary key, but multiple unique keys.

  • Primary key is automatically indexed, while unique key is not.

  • Example: Primary key for a table of students could be student_id, while unique key could be email.

Add your answer

Q26. Internal Working of HashMap

Ans.

Internal working of HashMap

  • HashMap is a data structure that stores key-value pairs

  • It uses hashing to store and retrieve values

  • The hash code of the key is used to find the index of the value in the array

  • If there is a collision, the values are stored in a linked list at that index

  • The load factor determines when the HashMap should resize

  • The default load factor is 0.75

  • HashMap is not thread-safe, use ConcurrentHashMap for thread safety

Add your answer

Q27. Explain oops with real word scenerios

Ans.

Object-oriented programming (OOP) is a programming paradigm that uses objects to represent real-world entities and their interactions.

  • OOP allows for modular and reusable code.

  • Encapsulation hides the internal details of an object.

  • Inheritance allows for the creation of subclasses with shared characteristics.

  • Polymorphism enables objects to take on multiple forms.

  • Abstraction simplifies complex systems by focusing on essential details.

Add your answer

Q28. Explain importance of static in java

Ans.

Static is important in Java for creating class-level variables and methods that can be accessed without creating an instance of the class.

  • Static variables are shared among all instances of a class

  • Static methods can be called without creating an object of the class

  • Static blocks are used for initializing static variables

  • Static keyword is used for creating nested classes

  • Static import is used to import static members of a class

Add your answer

Q29. Operaters in sql and languages

Ans.

Operators in SQL and programming languages are used to perform various operations on data.

  • SQL operators include arithmetic, comparison, logical, and bitwise operators.

  • Programming language operators include arithmetic, assignment, comparison, logical, and bitwise operators.

  • Examples of SQL operators are +, -, *, /, =, <>, >, <, AND, OR, NOT, &, |, ^.

  • Examples of programming language operators are +, -, *, /, =, ==, !=, >, <, &&, ||, !, &, |, ^, +=, -=, *=, /=.

Add your answer

Q30. Oops concepts in Java

Ans.

Oops concepts in Java

  • Object-oriented programming

  • Encapsulation

  • Inheritance

  • Polymorphism

  • Abstraction

  • Class

  • Object

  • Interface

  • Constructor

  • Method Overloading

  • Method Overriding

Add your answer

Q31. Pillars of OOPS.

Ans.

Pillars of OOPS are Inheritance, Encapsulation, Abstraction, and Polymorphism.

  • Inheritance: Allows a class to inherit properties and behavior from another class.

  • Encapsulation: Bundling data and methods that operate on the data into a single unit.

  • Abstraction: Hiding the complex implementation details and showing only the necessary features.

  • Polymorphism: Ability of a method to do different things based on the object it is acting upon.

Add your answer

Q32. Exception Vs Error

Ans.

Exceptions are events that can be handled programmatically, while errors are typically unrecoverable issues.

  • Exceptions are checked at compile time, while errors are unchecked.

  • Exceptions are subclasses of Throwable, while errors are subclasses of Error.

  • Examples of exceptions include NullPointerException, ArrayIndexOutOfBoundsException, while examples of errors include OutOfMemoryError, StackOverflowError.

Add your answer

Q33. Structure of JVM

Ans.

JVM is the virtual machine that runs Java bytecode, providing platform independence.

  • JVM stands for Java Virtual Machine

  • It is responsible for interpreting Java bytecode and executing it on the underlying hardware

  • JVM has components like Class Loader, Bytecode Verifier, Interpreter, Just-In-Time Compiler, and Garbage Collector

Add your answer

Q34. How Spring container works

Ans.

Spring container is responsible for managing the lifecycle of Spring beans and their dependencies.

  • Spring container creates and manages the objects (beans) defined in the Spring configuration file.

  • It injects dependencies, handles transactions, and manages the lifecycle of beans.

  • There are two types of Spring containers: BeanFactory and ApplicationContext.

  • ApplicationContext is preferred over BeanFactory as it provides more features like event handling, internationalization, etc.

Add your answer

Q35. What is HTML full form

Ans.

HTML stands for Hypertext Markup Language.

  • HTML is the standard markup language for creating web pages.

  • It is used to structure content on the internet using a system of tags.

  • Examples of HTML tags include <p> for paragraphs, <h1> for headings, and <a> for links.

Add your answer

Q36. What are Threads?

Ans.

Threads are lightweight processes within a program that can run concurrently, allowing for multitasking and improved performance.

  • Threads allow multiple tasks to be executed simultaneously within a single program

  • Threads share the same memory space, allowing for efficient communication and data sharing

  • Examples include a web server handling multiple client requests concurrently, or a video game running animations and user input processing simultaneously

Add your answer

Q37. Explain Serialisation in java

Ans.

Serialisation in Java is the process of converting an object into a byte stream for storage or transmission.

  • Serialisation allows objects to be saved and restored later.

  • It is used in Java to enable objects to be sent over a network or stored in a file.

  • The Serializable interface is implemented by classes to make them serializable.

  • The ObjectOutputStream class is used to write objects to a stream.

  • The ObjectInputStream class is used to read objects from a stream.

Add your answer

Q38. Int is integer or string

Ans.

Int is an abbreviation for integer, which is a numerical data type in programming.

  • Int is not a string, it is a data type used to represent whole numbers.

  • In Java, int is a primitive data type and is declared using the keyword 'int'.

  • Examples of int variables: int age = 25; int quantity = 10;

Add your answer

Q39. New functionalities in Java 8

Ans.

Java 8 introduced new features like lambda expressions, streams, functional interfaces, and default methods.

  • Lambda expressions allow you to write code in a more concise and readable way.

  • Streams provide a way to work with sequences of elements and perform operations like filter, map, reduce, etc.

  • Functional interfaces are interfaces with a single abstract method, which can be implemented using lambda expressions.

  • Default methods allow interfaces to have method implementations, r...read more

Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at NSK

based on 14 interviews in the last 1 year
1 Interview rounds
Technical Round
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Java Developer Interview Questions from Similar Companies

3.8
Ā ā€¢Ā 32 Interview Questions
3.8
Ā ā€¢Ā 28 Interview Questions
4.4
Ā ā€¢Ā 26 Interview Questions
3.6
Ā ā€¢Ā 18 Interview Questions
3.8
Ā ā€¢Ā 13 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
70 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

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