Airtel Africa
20+ Optimal Strategix Group Interview Questions and Answers
Q1. Find index of an element in a sorted, n-bit rotated array.
Finding index of an element in a sorted, n-bit rotated array.
Use binary search to find the pivot point where the array is rotated.
Determine which side of the pivot point the target element lies.
Perform binary search on the appropriate side of the pivot to find the target element.
Handle edge cases such as when the target element is the pivot point itself.
Q2. Build a single sorted linked list from two sorted linked list without using auxiliary space
Merge two sorted linked lists without using extra space
Traverse both lists simultaneously and compare nodes
Attach smaller node to result list and move pointer to next node
Repeat until both lists are exhausted
Return the head of the merged list
Q3. Find the first character with least occurrence in a string
Find the first character with least occurrence in a string
Iterate through the string and count the occurrence of each character
Find the character with the least occurrence
Return the first occurrence of that character
Q4. Meaning of dependency injection and inversion of control
Dependency injection is a design pattern that allows objects to receive dependencies from external sources, while inversion of control is a principle that states that the control of object creation and lifecycle should be handed over to a container or framework.
Dependency injection is a way to achieve loose coupling between objects
Inversion of control is a principle that promotes decoupling of components
Dependency injection is often used in conjunction with inversion of contr...read more
Q5. Difference between @Service, @Repository, @Component, @Controller
Annotations used in Spring Framework for different layers of application
All are used for dependency injection and component scanning
@Service is used for service layer
@Repository is used for data access layer
@Component is used for general purpose beans
@Controller is used for MVC controller layer
Q6. Difference between @Controller, @RestController
Difference between @Controller and @RestController
Both are used for handling HTTP requests in Spring framework
@Controller returns a view while @RestController returns data in JSON/XML format
@RestController is a combination of @Controller and @ResponseBody annotations
Use @Controller for traditional web applications and @RestController for RESTful web services
Q7. Design cars24 like system , what are the components and which design pattern i will use. Discussion on the design.
Design a system similar to cars24, discussing components and design patterns.
Components: User interface, database, search engine, recommendation engine, payment gateway
Design pattern: Model-View-Controller (MVC)
User interface: Allow users to search for cars, view car details, and make purchases
Database: Store car information, user details, and transaction history
Search engine: Enable users to search for cars based on various criteria
Recommendation engine: Suggest cars based o...read more
Q8. Difference between @Bean, @Component
Both @Bean and @Component are used for creating beans in Spring framework.
The @Bean annotation is used to explicitly declare a single bean.
The @Component annotation is used to declare a class as a Spring component.
The @Bean method is used in a configuration class to create and configure a bean.
The @Component annotation is used on a class to indicate that it is a Spring-managed component.
The @Bean method can be used to create a bean of any class, not just the one in which it i...read more
What are the different annotations being used and why?
What is Spring Boot JPA?
What are the disadvantages of Spring boot?
Q10. Clock angle problem, number to words
Clock angle problem and number to words are common coding problems.
Clock angle problem involves finding the angle between the hour and minute hand of a clock at a given time.
Number to words involves converting a given number into its word representation.
Both problems require logical thinking and can be solved using various approaches.
Clock angle problem can be solved using simple mathematical formulas while number to words can be solved using recursion or lookup tables.
Q11. write code for singleton design pattern write code for binary search write code to find minimum number of coins needed to get a number, given a list of denominations
Code for singleton design pattern, binary search, and finding minimum number of coins needed
For singleton design pattern, create a private static instance variable and a private constructor
For binary search, divide the array in half and compare the middle element with the target
For finding minimum number of coins, use dynamic programming and iterate through the denominations
How we load configuration on spring boot. Some leadership questions and project i have worked on
Print left view of Binary Tree
Q14. Write code to find the maximum time occupied room , given the slots of meetings.
Code to find the maximum time occupied room given meeting slots.
Sort the meeting slots based on start time.
Iterate through the sorted slots and keep track of the maximum occupied time.
Check for overlapping slots and update the maximum occupied time accordingly.
Q15. Hive file formats - differences between row and columnar file format
Row and columnar file formats in Hive differ in the way data is stored and accessed.
Row format stores data in a row-by-row manner, while columnar format stores data in a column-by-column manner.
Row format is suitable for OLTP workloads, while columnar format is suitable for OLAP workloads.
Columnar format allows for faster query performance and compression, while row format allows for faster inserts and updates.
Examples of row format include TextFile and SequenceFile, while ex...read more
Q16. System Design and Architecture - design a data pipeline to ingest data from streaming sources
Design a data pipeline to ingest data from streaming sources.
Identify the streaming sources and their data formats
Choose a streaming platform like Apache Kafka or AWS Kinesis
Design the pipeline architecture with data ingestion, processing, and storage components
Ensure scalability, fault-tolerance, and data consistency
Monitor and optimize the pipeline performance
Q17. write other methods of linked list
Other methods of linked list include doubly linked list, circular linked list, and sorted linked list.
Doubly linked list: Each node has a reference to the next and previous node.
Circular linked list: Last node points back to the first node, forming a circle.
Sorted linked list: Nodes are arranged in a sorted order based on a specific criteria.
Q18. What is primary annotation?
Primary annotation is used to indicate the primary key in a database table.
Primary annotation is used in Java Persistence API (JPA) to specify the primary key of an entity.
It is used with @Id annotation to define the primary key field in a database table.
Example: @Entity @Table(name = "employees") public class Employee { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "employee_id") private Long employeeId; }
Q19. What is a qualifier?
A qualifier in Java is a keyword used to specify additional information about a variable or method.
Qualifiers include 'final', 'static', 'abstract', 'public', 'private', 'protected', etc.
They are used to define the behavior and access level of variables and methods.
For example, 'final' qualifier makes a variable constant and 'static' qualifier allows a method to be called without creating an instance of the class.
Q20. start point of linked list
The start point of a linked list is the first node in the list.
The start point is typically referred to as the 'head' of the linked list.
It is the entry point for traversing the linked list.
Example: In a linked list with nodes A -> B -> C, A would be the start point.
Q21. write linked list
A linked list is a data structure where each element points to the next element in the sequence.
Create a Node class with data and next pointer
Initialize a head pointer to the first node
Traverse the list by following the next pointers
Insert and delete nodes by updating pointers accordingly
Interview Process at Optimal Strategix Group
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month