CGI Group
300+ Interview Questions and Answers
Ninja has been given a program to do basic string compression. For a character that is consecutively repeated more than once, he needs to replace the consecutive duplicate occurrences with th...read more
There is a frog on the 1st step of an N stairs long staircase. The frog wants to reach the Nth stair. HEIGHT[i] is the height of the (i+1)th stair.If Frog jumps from ith to jth stair, the energy lost i...read more
You have been given a string STR. Your task is to find the total number of palindromic substrings of STR.
Example :
If the input string is "abbc", then all the possible palindromic substri...read more
Pre-requisites: Anagrams are defined as words or names that can be formed by rearranging letters of another word. Such as "spar" can be formed by rearranging letters of "rasp". Hence, "spar" and "r...read more
You are given a sorted array of 'N' integers. You have to generate the power set for this array where each subset of this power set is individually sorted.
A set is a well-defined collection of distinc...read more
You are given an array of n integers (a1, a2,....,an), you need to find if the array contains a pythagorean triplet or not.
An array is said to have a pythagorean triplet if there exists thr...read more
You are given two Singly Linked List of integers, which are merging at some node of a third linked list.
Your task is to find the data of the node at which merging starts. If there is...read more
You have been given an array/list 'PREORDER' representing the preorder traversal of a BST with 'N' nodes. All the elements in the given array have distinct values.
Your task is to con...read more
You are given a string STR of length N. Your task is to remove all the vowels present in that string and print the modified string.
English alphabets ‘a’, ‘e’, ‘i’, ‘o’, ‘u’ are termed as vowels. A...read more
You are given a N x M matrix of integers, print the spiral path of the matrix.
For example:
Input Format:
The first line contains an integer 'T' which denotes the number of test cases or queries t...read more
What are the various access specifiers in Java?
You are given an array of integers 'ARR' of length 'N' and an integer Target. Your task is to return all pairs of elements such that they add up to Target.
Note:
We cannot use the element at a given inde...read more
You are given three non-zero numbers ‘A’, ‘B’, and ‘C’. The task is to find the number formed by concatenating the largest digit from each of these numbers in the order of ‘A’, ‘B’,...read more
How many types of memory areas are allocated by JVM?
Q15. 1,Diff bwn aggregation and composition? 2,w a p to print fibnoci sries? with recursion? 3,Diff bwn interface and abstract? 4,w ap to print * patteren? * ** *** **** 5,Explain custom immutable class? 6,what is i...
read moreThis JSON contains answers to interview questions for a Software Engineer position.
Aggregation and composition are both forms of association in object-oriented programming.
Aggregation represents a 'has-a' relationship, where one object contains another object as a part.
Composition is a stronger form of aggregation, where the lifetime of the contained object is controlled by the container object.
Fibonacci series can be printed using recursion by defining a recursive function t...read more
What are the types of design patterns in Java?
What is the purpose of using @ComponentScan in the class files?
What do you know about JIT compiler?
What Are the Basic Annotations that Spring Boot Offers?
OOPS concepts with real time example
SQL statements paper based
Pointers are available in java if not available why
Diff between unions and structures
Concept on procedures and functions i...read more
What is the difference between JDK, JRE, and JVM?
Write a query that joins two tables A and B having common attribute ID and selects records(ID_NAME) that have
matching ID values in both tables .
What do you mean by data encapsulation?
What are global, protected and private attributes in Python?
What is dependency Injection?
What is a Slowly Changing Dimension (SCD)? What are the different types of SCDs?
Q27. What is the difference between emergency and urgent change? Emergency change is raised to resolve an incident. It doesn’t follow the normal change process and do not have a lead time. ECAB needs to be arranged....
read moreEmergency change is raised to resolve an incident while urgent change needs top level approvals to proceed.
Emergency change is not a part of the normal change process and does not have a lead time.
ECAB needs to be arranged for emergency change.
Urgent change needs to be implemented on an urgent basis and cannot wait to follow the entire change process.
Top level approvals are required for urgent change to proceed.
What is the main difference between UNION and UNION ALL?
Explain the use of final keyword in variable, method and class.
Q30. What happens when a change is unsuccessful? When a change fails a PIR call needs to be arranged in order to understand the reason and root cause of the failure also what differently would be done next time to a...
read moreA PIR is conducted to understand the reason and root cause of the failure and to document and update it.
Conduct a PIR to understand the reason and root cause of the failure
Document and update the PIR
Identify what could be done differently next time to avoid such a situation
What is Cursor? How to use a Cursor?
What is pickling and unpickling?
What is the difference between the interrupted() and isInterrupted() method in Java?
What are the different types of data marts in the context of data warehousing?
Given an Employee Table, find the Nth highest salary from it.
What is the use of self in Python?
What is init method in python?
How does inheritance work in python?
Q39. how can you improve performance of your spring boot application
To improve performance of a Spring Boot application, consider optimizing database queries, caching, using asynchronous processing, and monitoring performance metrics.
Optimize database queries by using indexes, avoiding N+1 queries, and limiting the amount of data fetched.
Implement caching to store frequently accessed data in memory, reducing the need to fetch data from the database repeatedly.
Use asynchronous processing for time-consuming tasks to free up resources and improv...read more
Q40. how did you implement logging in your springboot application
Implemented logging in Spring Boot application using SLF4J and Logback
Added dependencies for SLF4J and Logback in pom.xml
Configured logback.xml for logging levels and appenders
Injected Logger instances using @Autowired annotation in classes
Used logger.debug(), logger.info(), logger.error() methods for logging
What is the difference between Python Arrays and lists?
Difference between Abstract class and Interface.
How to delete Duplicates From a Table in SQL Server?
Print 1 to 100 using more than two threads(optimized approach).
What are Java 8 streams?
What are the features of a lambda expression?
How to deploy a Big Data Model? Mention the key steps involved
Q48. Coding question - 1. Create a immutable class of orders. What happens when two objects are created out of it. 2.Using the immutable orders create a set of orders and how will you sort these out. 3.Given a List ...
read moreCreating immutable class of orders, sorting orders, finding average of lists of integers.
Create an immutable class Orders with private final fields and no setter methods.
Override equals() and hashCode() methods to ensure uniqueness of objects.
Use Collections.unmodifiableSet() to create a set of orders and Collections.sort() to sort them.
Iterate through the List of List of String of integers, convert to integers, and calculate average for each list.
Q49. a clock tick 8 times on 8'o clock the time taken between 1st tick and last tick is 35 sec what is the time taken for starting tick and end tick at 11'o colck
The time taken for the clock to tick from 8'o clock to 11'o clock is 105 seconds.
Each tick represents 1/8th of an hour (45 minutes) on the clock.
From 8'o clock to 11'o clock, there are 3 hours, so the total time taken is 3 * 45 = 135 minutes = 135 * 60 = 8100 seconds.
The time taken for the clock to tick from 8'o clock to 11'o clock is 8100 - 35 = 8065 seconds.
Can you tell the difference between setMaxResults() and setFetchSize() of Query?
Explain overfitting in big data? How to avoid the same.
What are the advantages of Packages in Java?
Why Java is platform independent and JVM platform dependent?
How to get second max salary from table?
What is the use of DROP command and what are the differences between DROP, TRUNCATE and DELETE
commands?
What is race condition in Java? Given one example.
What is the difference between CHAR and VARCHAR2 datatype in SQL?
What do you mean by Degenerate Dimension?
Q60. Write a code to find Number of occurrences of a word in a string
Code to find number of occurrences of a word in a string
Split the string into an array of words
Loop through the array and count the occurrences of the given word
State difference between ETL testing and manual testing.
Why should Selenium be selected as a testing tool for web applications or systems?
How do you check how much space left in current drive ?
What are the concurrency strategies available in hibernate?
What do you know about the Bus Schema in ETL.
Q66. What is pass by reference and pass by value
Pass by reference and pass by value are two ways of passing arguments to a function.
Pass by value means a copy of the argument is passed to the function
Pass by reference means the memory address of the argument is passed to the function
Pass by value is used for primitive data types like int, float, etc.
Pass by reference is used for complex data types like arrays, objects, etc.
How can you run a selected test from a group of tests in Cucumber?
Difference between Process and Program
How do you find all the process which has opened a file in Linux?
What is LVM and why is it required?
Explain @RestController annotation in Sprint boot?
What is the difference between an Array and ArrayList in C#?
Q73. Singleton can be broken by cloning, how to prevent it?
To prevent Singleton from being broken by cloning, we can override the clone method and throw an exception.
Override the clone method in the Singleton class and throw an exception to prevent cloning.
Alternatively, you can return the same instance in the clone method instead of creating a new instance.
Use serialization and deserialization to create a new instance of the Singleton class.
How to Take a Backup of a Table in MySQL?
Can you tell something about the N+1 SELECT problem in Hibernate?
Q76. When a function is passed as an argument to another function. Then it is a callback function
Yes, a callback function is a function that is passed as an argument to another function.
Callback functions are commonly used in event handling, asynchronous programming, and functional programming.
Example: setTimeout(function() { console.log('Hello!'); }, 1000);
Example: array.map(function(item) { return item * 2; });
What is hibernate caching?
Explain the use of final keyword in variable, method and class.
Explain Hadoop. List the core components of Hadoop
State difference between ETL and OLAP (Online Analytical Processing) tools.
Q81. What is intial sql, how and when do you write catom sql in tableau, what is cat in sql...and some project related questions
Initial SQL is a feature in Tableau that allows users to write custom SQL queries to connect to data sources.
Initial SQL is used to execute SQL statements before the main query is executed.
Custom SQL can be written in Tableau to connect to data sources that do not have a built-in connector.
CAT in SQL stands for Concatenate and is used to combine two or more strings into a single string.
Project related questions may vary depending on the specific project and requirements.
What is the meaning of a file that has 644 permission?
Difference between Process and Thread
Explain briefly how Behavioral Driven Development works?
How do you automate the testing of CAPTCHA?
Explain the Storage Unit In Hadoop (HDFS).
HDFS is the storage unit in Hadoop, providing fault-tolerant and scalable storage for big data.
HDFS divides data into blocks and stores them across multiple machines in a cluster.
It replicates data for fault tolerance, with default replication factor of 3.
HDFS supports streaming data access and is optimized for large sequential reads.
It provides high throughput and reliability for big data processing.
HDFS is suitable for storing and processing large datasets in parallel.
Q87. How are 4-5 microservices connected in rest api's? which technique you are using?
Microservices are connected in REST APIs using communication protocols like HTTP, messaging queues, and service discovery.
Microservices communicate with each other using HTTP requests and responses.
Messaging queues like RabbitMQ or Kafka can be used for asynchronous communication between microservices.
Service discovery tools like Eureka or Consul help in locating and connecting to different microservices.
API Gateway can be used to aggregate multiple microservices into a singl...read more
What do chmod, chown, chgrp commands do?
Q89. Are you aware of DevOp? How to use in producing output for client?
Yes, DevOps is a set of practices that combines software development and IT operations to deliver high-quality software faster.
DevOps is a culture and set of practices that emphasizes collaboration, automation, and monitoring throughout the software development lifecycle.
It involves integrating development, testing, deployment, and operations teams to streamline the software delivery process.
By using DevOps, database architects can ensure faster and more reliable delivery of ...read more
What is a “/proc” file system?
Q91. what is oop concept, difference b/w interface and abstract class
OOP concept focuses on creating objects that interact with each other. Interface is a contract for classes to implement, while abstract class can have some implemented methods.
OOP concept involves creating objects that have properties and methods to interact with each other
Interface is a contract that defines a set of methods that a class must implement
Abstract class can have some implemented methods along with abstract methods that must be implemented by subclasses
Explain the Singleton pattern?
Difference b/w INNER JOIN and OUTER JOIN in SQL.
Q95. How to creat web page by using html and css
HTML and CSS are used to create web pages.
Start with creating the basic structure of the page using HTML tags.
Use CSS to style the page and make it visually appealing.
Add content to the page using HTML tags.
Use CSS to position and layout the content on the page.
Test the page in different browsers to ensure compatibility.
Q96. How many times we use for loop in single program
The number of times a for loop is used in a program varies depending on the program's requirements.
The number of for loops used in a program depends on the program's logic and requirements.
For loops are used to iterate over arrays, lists, and other data structures.
Nested for loops are used to iterate over multi-dimensional arrays.
For loops can also be used for counting and other repetitive tasks.
The number of for loops used in a program can range from zero to many.
Write a command to print the lines that has the word "july" while ignoring the case.
Q98. write the queries to find out nth and 3rd highest record
Use SQL queries with ORDER BY and LIMIT to find nth and 3rd highest record.
Use ORDER BY column_name DESC to sort records in descending order
Use LIMIT 1 OFFSET n-1 to get the nth highest record
For 3rd highest record, use LIMIT 1 OFFSET 2
Explain ETL Process in Data Warehouse
Difference between Fact Table and Dimension Table
More about working at CGI Group
Top HR Questions asked in null
Interview Process at null
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month