Oracle
30+ TEXCO FASHIONS Interview Questions and Answers
Q1. 1. Write a program to remove duplicate elements from String and mention the count of duplication.
Program to remove duplicate elements from String and count their occurrences.
Create a HashSet to store unique characters from the String.
Iterate through the String and add each character to the HashSet.
While adding, check if the character already exists in the HashSet and increment its count.
Print the count of each character that has duplicates.
Return the modified String with duplicates removed.
Q2. 4. What is marker interface? Example of marker interface. Why it is used.
Marker interface is an interface with no methods. It is used to mark a class for special treatment.
Marker interface is used to provide metadata to the JVM.
It is used to indicate that a class has some special behavior or characteristics.
Example: Serializable interface in Java.
Marker interfaces are used for reflection and serialization.
They are also used in frameworks like Spring and Hibernate.
Marker interfaces are also known as tagging interfaces.
They are used to group classes...read more
Q3. 2. Write a program to capitalise all the first letter of a word in a sentence.
A program to capitalize the first letter of each word in a sentence.
Split the sentence into words
Loop through each word and capitalize the first letter
Join the words back into a sentence
Q4. 6. Consider an array of String, remove those string from array whose length is less than 3.
Remove strings from an array whose length is less than 3.
Loop through the array and check the length of each string.
If the length is less than 3, remove that string from the array.
Use a for loop or filter method to remove the strings.
Example: ['cat', 'dog', 'bird', 'elephant'] -> ['cat', 'dog', 'bird', 'elephant']
Example: ['a', 'to', 'the', 'in'] -> ['the', 'in']
Q5. 4. When to use list and when to use linked list.
Lists are used for small collections, linked lists for large or frequently modified collections.
Use lists for small collections that don't require frequent modifications.
Use linked lists for large collections or collections that require frequent modifications.
Linked lists are better for inserting or deleting elements in the middle of the collection.
Lists are better for accessing elements by index.
Example: Use a list to store a small list of names, use a linked list to impleme...read more
Q6. What is the difference between a micro controller and a micro processor?
Microcontroller is a self-contained system with memory, peripherals and processor, while microprocessor only has a processor.
Microcontroller has on-chip memory and peripherals, while microprocessor requires external memory and peripherals.
Microcontroller is used in embedded systems, while microprocessor is used in general-purpose computing.
Examples of microcontrollers include Arduino, PIC, and AVR, while examples of microprocessors include Intel Pentium, AMD Ryzen, and ARM Co...read more
Q7. 10. Write a program to separate even and odd numbers using Java 8.
Program to separate even and odd numbers using Java 8.
Use Java 8 Stream API to filter even and odd numbers
Create two separate lists for even and odd numbers
Use lambda expressions to filter the numbers
Example: List
evenNumbers = numbers.stream().filter(n -> n % 2 == 0).collect(Collectors.toList()); Example: List
oddNumbers = numbers.stream().filter(n -> n % 2 != 0).collect(Collectors.toList());
Q8. 3. How to remove sensitive information from serializable interface.
Sensitive information can be removed from serializable interface by implementing custom serialization.
Create a custom serialization method that excludes sensitive information.
Use the transient keyword to mark sensitive fields as non-serializable.
Consider using encryption or hashing to protect sensitive data.
Test serialization and deserialization to ensure sensitive information is not included.
Examples: exclude passwords, credit card numbers, and personal identification inform...read more
Q9. Can an array have elements of different data types?
Yes, an array can have elements of different data types.
An array can have elements of different data types, but it's not recommended.
It can make the code harder to read and maintain.
For example, an array can have both strings and numbers: ['apple', 5, 'banana']
Q10. 3. How map works internally in Java
Java Map is an interface that maps unique keys to values. It works internally using hash table data structure.
Map interface is implemented by HashMap, TreeMap, LinkedHashMap, etc.
Keys in a map must be unique and values can be duplicated.
Hash table data structure is used to store key-value pairs internally.
Hashing is used to convert keys into indices of an array where values are stored.
Collision resolution techniques like chaining and open addressing are used to handle collisi...read more
Q11. What is a linked list ? What are its uses?
A linked list is a linear data structure where each element is a separate object linked together by pointers.
Linked list is used to implement stacks, queues, and hash tables.
It is used in computer memory allocation.
It is used in image processing to represent pixels.
It is used in music player to create a playlist.
It is used in web browsers to store the history of visited web pages.
Q12. 5. Difference between primitives and wrapper class in Java.
Primitives are basic data types in Java while wrapper classes are objects that wrap around primitives.
Primitives are faster and take less memory than wrapper classes.
Wrapper classes provide additional functionality like conversion to and from strings.
Primitives are passed by value while wrapper classes are passed by reference.
Examples of primitives include int, boolean, and double while examples of wrapper classes include Integer, Boolean, and Double.
Q13. 1. What are the different layers of OSI model.
The OSI model has 7 layers that define how data is transmitted over a network.
Layer 1: Physical layer - deals with the physical aspects of transmitting data
Layer 2: Data link layer - responsible for error-free transfer of data between nodes
Layer 3: Network layer - handles routing of data between different networks
Layer 4: Transport layer - ensures reliable delivery of data between applications
Layer 5: Session layer - establishes and manages connections between applications
Lay...read more
Q14. What are data structures?
Data structures are ways of organizing and storing data in a computer so that it can be accessed and used efficiently.
Data structures can be linear or non-linear
Examples of linear data structures include arrays, linked lists, and stacks
Examples of non-linear data structures include trees and graphs
Choosing the right data structure is important for optimizing performance and memory usage
Q15. 2. What are different layers of TCP/IP model.
TCP/IP model has four layers: Application, Transport, Internet, and Network Access.
Application layer handles high-level protocols like HTTP, FTP, SMTP, etc.
Transport layer provides end-to-end communication between hosts using TCP or UDP protocols.
Internet layer handles the routing of data packets between networks using IP protocol.
Network Access layer deals with the physical transmission of data over the network.
Examples of protocols at each layer: HTTP (Application), TCP (Tr...read more
Q16. 2. Difference between String Buffer and String Builder
String Buffer and String Builder are both used to manipulate strings, but the former is synchronized while the latter is not.
String Buffer is thread-safe while String Builder is not
String Builder is faster than String Buffer
String Builder is preferred when thread safety is not a concern
String Buffer is used when multiple threads are involved in manipulating the same string
Both classes have similar methods for appending, inserting, and deleting characters
Q17. 9. Difference between @Service and @Component.
Difference between @Service and @Component
Both are used for component scanning in Spring
@Service is used for service layer classes
@Component is used for general purpose beans
Service layer classes contain business logic
Examples of @Service: UserService, ProductService
Examples of @Component: DAO, Utility classes
Q18. 5. Explain the process of data communication using TCP/IP model.
TCP/IP model is a protocol used for data communication. It consists of four layers: application, transport, internet, and network access.
Data is sent from the application layer to the transport layer where it is divided into segments.
The internet layer adds IP addresses to the segments and sends them to the network access layer.
The network access layer adds physical addresses and sends the data over the network.
The process is reversed at the receiving end.
Examples of TCP/IP p...read more
Q19. Explain about the transaction that happen in a bank
Transactions in a bank involve the movement of funds between accounts or the exchange of currency.
Transactions can be initiated by customers or by the bank itself
Common types of transactions include deposits, withdrawals, transfers, and loans
Transactions are recorded in the bank's ledger and may be subject to fees or interest
Electronic transactions have become increasingly popular, such as online banking and mobile payments
Q20. 1. Difference between String and String Buffer.
String is immutable while StringBuffer is mutable.
String objects are constant and cannot be changed once created.
StringBuffer objects are mutable and can be modified.
StringBuffer is thread-safe while String is not.
StringBuffer has methods to append, insert, and delete while String does not.
Example: String str = "hello"; StringBuffer sb = new StringBuffer("world");
str.concat("world"); // returns a new string "helloworld"
sb.append("hello"); // modifies the existing StringBuffer...read more
Q21. 3. Difference between TCP, UDP and TLS protocol.
TCP is a reliable, connection-oriented protocol. UDP is a connectionless protocol. TLS is a secure protocol for data encryption.
TCP ensures reliable data transmission by establishing a connection between sender and receiver.
UDP is faster but less reliable as it does not establish a connection before sending data.
TLS provides secure communication by encrypting data and verifying the identity of the communicating parties.
TCP and UDP are transport layer protocols while TLS is a ...read more
Q22. 5. Difference type of HTTP request in Spring Boot.
There are four types of HTTP requests in Spring Boot: GET, POST, PUT, and DELETE.
GET: used to retrieve data from a server
POST: used to submit data to a server
PUT: used to update existing data on a server
DELETE: used to delete data from a server
These requests are handled by the @RequestMapping annotation in Spring Boot
Q23. 11. Different types of spring boot annotations.
Spring Boot annotations are used to simplify the development process. Some common annotations are @SpringBootApplication, @RestController, @Autowired, @GetMapping, @PostMapping, @Service, @Repository, @Component, etc.
The @SpringBootApplication annotation is used to mark the main class of the application.
The @RestController annotation is used to mark a class as a RESTful controller.
The @Autowired annotation is used to inject dependencies.
The @GetMapping and @PostMapping annota...read more
Q24. 7. Why String is immutable
String is immutable because it cannot be changed once created.
Immutable objects are safer to use in multi-threaded environments.
String pool in Java is possible because of immutability.
StringBuffer and StringBuilder are mutable alternatives to String.
Q25. 10. Remove the duplicate elements in an array.
Remove duplicate elements in an array.
Create a new empty array.
Loop through the original array and check if the element already exists in the new array.
If it doesn't exist, add it to the new array.
Return the new array without duplicates.
Q26. explain the four pillars of OOPS, their significance and how you leveraged them in your projects?
The four pillars of OOPS are encapsulation, inheritance, polymorphism, and abstraction.
Encapsulation: Bundling data and methods that operate on the data into a single unit. Example: Using private variables and public methods in a class.
Inheritance: Allowing a new class to inherit properties and behavior from an existing class. Example: Creating a subclass that inherits from a superclass.
Polymorphism: The ability to present the same interface for different data types. Example:...read more
Q27. 7. Uses of Factory Design Pattern
Factory Design Pattern is used to create objects without exposing the creation logic to the client.
It provides a way to delegate the object creation to a factory class.
It helps in achieving loose coupling between classes.
It is useful when we have a super class with multiple sub-classes and based on input, we need to return one of the sub-class.
Examples include: java.util.Calendar, java.text.NumberFormat, java.nio.charset.Charset
Q28. 8. Different type of HTTP response code.
HTTP response codes indicate the status of a web request. There are 5 categories of codes.
1xx - Informational
2xx - Success
3xx - Redirection
4xx - Client Error
5xx - Server Error
Q29. 6. Explain JVM architecture.
JVM is an abstract machine that executes Java bytecode. It consists of class loader, runtime data area, and execution engine.
JVM stands for Java Virtual Machine.
It is responsible for executing Java bytecode.
JVM architecture consists of class loader, runtime data area, and execution engine.
Class loader loads the class files into the memory.
Runtime data area is divided into method area, heap, and stack.
Execution engine executes the bytecode.
JVM provides platform independence to...read more
Q30. 9. Types of functional interface.
Functional interfaces are interfaces with only one abstract method. There are four types of functional interfaces.
Consumer: accepts a single argument and returns no result. Example: Consumer
Supplier: takes no argument and returns a result. Example: Supplier
Predicate: takes a single argument and returns a boolean. Example: Predicate
Function: takes a single argument and returns a result. Example: Function
Q31. Different ways to write PLSQL package and it's procedures and functions
PLSQL packages can be written in different ways. Here are some pointers.
Packages can be written in a single file or multiple files.
Procedures and functions can be written inside the package or outside the package.
Packages can be created using CREATE PACKAGE statement or CREATE OR REPLACE PACKAGE statement.
Packages can be compiled in debug mode using the keyword 'DEBUG'.
Q32. 8. Different Java 8 features.
Java 8 introduced several new features including lambda expressions, streams, and default methods.
Lambda expressions allow for functional programming and simplify code.
Streams provide a way to process collections of data in a functional way.
Default methods allow for adding new methods to interfaces without breaking existing implementations.
Other features include the Optional class, Date and Time API, and Nashorn JavaScript engine.
Example: Lambda expression - (x, y) -> x + y
Ex...read more
Q33. 4. Explain SIP signalling.
SIP signalling is a protocol used for initiating, modifying, and terminating real-time sessions that involve video, voice, messaging, and other communications applications.
SIP stands for Session Initiation Protocol.
It is used to establish, modify, and terminate multimedia sessions.
SIP signalling is used in VoIP (Voice over Internet Protocol) and other real-time communication applications.
It uses a request-response model, where a client sends a request to a server and the serv...read more
Q34. Triggers and it's types and importance.
Triggers are database objects that are used to automatically execute a set of actions when a specific event occurs.
Triggers can be of two types: DML triggers and DDL triggers.
DML triggers are fired in response to DML (Data Manipulation Language) events like INSERT, UPDATE, and DELETE.
DDL triggers are fired in response to DDL (Data Definition Language) events like CREATE, ALTER, and DROP.
Triggers are important as they help in maintaining data integrity, enforcing business rule...read more
Q35. What is oops?
OOPs stands for Object-Oriented Programming. It is a programming paradigm based on the concept of objects.
OOPs is a way of organizing and designing code around objects
It emphasizes on encapsulation, inheritance, and polymorphism
It helps in creating reusable and modular code
Examples of OOPs languages are Java, C++, Python, etc.
More about working at Oracle
Top HR Questions asked in TEXCO FASHIONS
Interview Process at TEXCO FASHIONS
Top Associate Consultant Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month