UST
30+ Spentex Industries Interview Questions and Answers
Q1. Nth Prime Number Problem Statement
Find the Nth prime number given a number N.
Explanation:
A prime number is greater than 1 and is not the product of two smaller natural numbers. A prime number has exactly two...read more
The task is to find the Nth prime number given a number N.
A prime number is a number greater than 1 that is not a product of two smaller natural numbers.
Prime numbers have only two factors - 1 and the number itself.
Start with a counter at 0 and a number at 2.
Increment the number by 1 and check if it is prime.
If it is prime, increment the counter.
Repeat until the counter reaches N.
Return the last prime number found.
Q2. LRU Cache Design Problem Statement
Design and implement a data structure for a Least Recently Used (LRU) cache that supports the following operations:
get(key)
- Retrieve the value associated with the specifie...read more
The question is about designing and implementing a data structure for LRU cache to support get and put operations.
LRU cache is a cache replacement policy that removes the least recently used item when the cache reaches its capacity.
The cache is initialized with a capacity and supports get(key) and put(key, value) operations.
For each get operation, return the value of the key if it exists in the cache, otherwise return -1.
For each put operation, insert the value in the cache i...read more
Q3. Excel Column Number Conversion
Given a column title as it appears in an Excel sheet, your task is to return its corresponding column number.
Example:
Input:
S = "AB"
Output:
28
Explanation:
The sequence is as f...read more
The start() method is used to start a new thread and execute the run() method.
The start() method creates a new thread and calls the run() method.
The run() method contains the code that will be executed in the new thread.
Calling the run() method directly will not create a new thread.
The start() method should be called to start the execution of the new thread.
Garbage collector in Java is responsible for automatic memory management.
Garbage collector automatically reclaims memory by freeing objects that are no longer referenced.
It runs in the background and identifies unused objects based on reachability.
Different garbage collection algorithms like Mark and Sweep, Copying, and Generational are used.
Garbage collector can be tuned using JVM options like -Xmx and -Xms.
Example: System.gc() can be used to suggest garbage collection, but ...read more
Exception handling is a mechanism in programming to handle and manage errors or exceptional situations that may occur during program execution.
Exception handling is used to catch and handle errors or exceptions in a program.
It allows the program to gracefully handle errors and prevent abrupt termination.
Exception handling involves the use of try-catch blocks to catch and handle exceptions.
The catch block contains code to handle the exception, such as displaying an error messa...read more
HashSet is an unordered collection that uses hashing to store elements, while TreeSet is a sorted collection that uses a binary search tree.
HashSet does not maintain any order of elements, while TreeSet maintains elements in sorted order.
HashSet allows null values, while TreeSet does not allow null values.
HashSet has constant time complexity for basic operations like add, remove, and contains, while TreeSet has logarithmic time complexity.
HashSet is generally faster for addin...read more
Thread Scheduler is responsible for managing the execution of multiple threads in a multitasking environment.
Thread Scheduler determines the order in which threads are executed.
It allocates CPU time to each thread based on priority and scheduling algorithm.
Time Slicing is a technique used by Thread Scheduler to allocate a fixed time slice to each thread before switching to another.
It ensures fair execution of threads and prevents a single thread from monopolizing the CPU.
Exam...read more
Thread starvation occurs when a thread is unable to access the CPU resources it needs to execute its tasks.
Thread starvation happens when a thread is constantly waiting for a resource that is being monopolized by other threads.
It can occur due to poor resource management or priority scheduling.
Examples include a low-priority thread being constantly preempted by high-priority threads or a thread waiting indefinitely for a lock held by another thread.
Abstract class is a class that cannot be instantiated and can have both abstract and non-abstract methods. Interface is a blueprint for a class and can only have abstract methods.
Abstract class can have constructors while interface cannot.
A class can implement multiple interfaces but can only extend one abstract class.
Abstract class can have instance variables while interface cannot.
Abstract class can provide default implementations for some methods while interface cannot.
Int...read more
BlockingQueue is a thread-safe queue that blocks when it is full or empty.
BlockingQueue is part of the Java Concurrency API.
It provides methods like put() and take() to add and remove elements from the queue.
When the queue is full, put() blocks until space becomes available.
When the queue is empty, take() blocks until an element is available.
It is commonly used in producer-consumer scenarios.
Q19. Explain SDLC and STLC, Whats the difference between list and tuple Whats the assert and verify Elements
SDLC and STLC, list vs tuple, assert vs verify
SDLC (Software Development Life Cycle) is a process followed to develop software
STLC (Software Testing Life Cycle) is a process followed to test software
List and tuple are both data structures in Python, but list is mutable while tuple is immutable
Assert is used to check if a condition is true, while verify is used to check if a web element is present
Both assert and verify are used in automated testing
Example: assert 2+2 == 4, ver...read more
Q23. Difference between RestController and Controller annotations
RestController is used for RESTful web services while Controller is used for general web requests.
RestController is a specialization of Controller annotation in Spring framework.
RestController is used to create RESTful web services that return JSON or XML data.
Controller is used for handling general web requests and returning views (HTML).
RestController is typically used for APIs while Controller is used for traditional web applications.
Q25. Annotations used for making an API
Annotations are used to provide metadata about classes, methods, or fields in an API.
Annotations can be used to provide information about how a method should be handled, such as whether it is deprecated or should be ignored by a compiler.
Annotations can also be used to provide information about how a class should be serialized or deserialized, such as specifying the format of JSON data.
Examples of annotations include @Deprecated, @Override, @JsonProperty, and @JsonIgnore.
Q26. Use Multithreading to print 1 to 100 numbers
Use multithreading to print 1 to 100 numbers.
Create a class that implements Runnable interface
Override the run() method to print numbers
Create multiple threads and start them
Join all threads to ensure all numbers are printed
Q27. Spring/ Springboot uses
Spring/Spring Boot is a popular Java framework for building enterprise applications.
Spring is a lightweight framework for building Java applications
Spring Boot is an extension of the Spring framework that simplifies the setup and configuration of Spring applications
Spring provides features like dependency injection, aspect-oriented programming, and more
Spring Boot includes embedded servers like Tomcat, Jetty, etc. for easy deployment
Spring Boot also provides auto-configuratio...read more
Q28. Difference between procedures and functions
Procedures do not return a value, while functions return a value.
Procedures are used to perform a specific task, while functions are used to calculate and return a value.
Functions can be called from within expressions, while procedures cannot.
Procedures can have input and output parameters, while functions can only have input parameters.
Example: Procedure to print a message vs Function to calculate the square root of a number.
Q29. explain STLC procedure for test
STLC (Software Testing Life Cycle) is a systematic process for testing software applications.
STLC involves planning, designing, executing, and reporting tests.
Phases of STLC include requirement analysis, test planning, test design, test execution, and test closure.
Each phase has specific activities and deliverables to ensure thorough testing of the software.
STLC helps in identifying defects early in the development cycle, reducing costs and improving software quality.
Q30. OOPS concepts and usage
OOPS concepts are fundamental principles in object-oriented programming that help in organizing and designing code.
Encapsulation: Bundling data and methods that operate on the data into a single unit (class).
Inheritance: Allowing a class to inherit properties and behavior from another class.
Polymorphism: Ability to present the same interface for different data types.
Abstraction: Hiding the complex implementation details and showing only the necessary features to the user.
Q31. explain testing frame work
Testing framework is a set of guidelines, tools, and processes used to automate and standardize the testing of software applications.
Testing framework provides a structure for organizing test cases and executing them.
It includes tools for test automation, such as Selenium for web applications or JUnit for Java.
Frameworks like TestNG or PyTest offer features like test parameterization, grouping, and reporting.
Frameworks help in maintaining consistency and efficiency in testing...read more
Q32. explain selenium tech nology
Selenium is a popular open-source automation testing tool used for web application testing.
Selenium is used for automating web browsers.
It supports multiple programming languages like Java, Python, C#, etc.
Selenium WebDriver is the most commonly used component for writing automation scripts.
Selenium Grid allows for parallel test execution across different browsers and operating systems.
Q33. Indexing in Sql
Indexing in SQL is a technique used to improve the performance of queries by creating indexes on columns in database tables.
Indexes are created on columns in database tables to speed up data retrieval.
Indexes can be created using CREATE INDEX statement in SQL.
Indexes can be unique or non-unique, clustered or non-clustered.
Examples: CREATE INDEX idx_lastname ON employees(last_name);
Q34. Design pattern in C#
Design patterns in C# are reusable solutions to common problems in software design.
Design patterns help in creating maintainable and scalable code.
Examples of design patterns in C# include Singleton, Factory, Observer, and Strategy.
Each design pattern has its own purpose and implementation details.
More about working at UST
Top HR Questions asked in Spentex Industries
Interview Process at Spentex Industries
Top Senior Software Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month