Add office photos
Engaged Employer

CGI Group

4.0
based on 4.5k Reviews
Video summary
Proud winner of ABECA 2024 - AmbitionBox Employee Choice Awards
Filter interviews by

300+ Aker Solutions Interview Questions and Answers

Updated 11 Feb 2025
Popular Designations

Q1. String Compression Problem Statement

Ninja needs to perform basic string compression. For any character that repeats consecutively more than once, replace the repeated sequence with the character followed by th...read more

Ans.

Implement a function to compress a string by replacing consecutive characters with the character followed by the count of repetitions.

  • Iterate through the input string and keep track of consecutive characters and their counts

  • Replace consecutive characters with the character followed by the count of repetitions if count is greater than 1

  • Return the compressed string

View 1 answer

Q2. Frog Jump Problem Statement

A frog is positioned on the first step of a staircase consisting of N steps. The goal is for the frog to reach the final step, i.e., the Nth step. The height of each step is provided...read more

Ans.

Calculate the minimal energy required for a frog to travel from the first step to the last step of a staircase.

  • Iterate through the staircase steps and calculate the energy cost for each jump.

  • Keep track of the minimum energy cost to reach each step.

  • Consider jumping either one step or two steps ahead to minimize energy cost.

  • Return the total minimal energy cost to reach the last step.

Add your answer

Q3. Anagram Pairs Verification Problem

Your task is to determine if two given strings are anagrams of each other. Two strings are considered anagrams if you can rearrange the letters of one string to form the other...read more

Ans.

Determine if two strings are anagrams of each other by checking if they have the same characters in different order.

  • Create a frequency map of characters for both strings and compare them.

  • Sort both strings and compare if they are equal.

  • Use a dictionary to count the occurrences of each character in both strings and compare the dictionaries.

Add your answer

Q4. Palindromic Substrings Problem Statement

You are given a string 'STR'. Your task is to determine the total number of palindromic substrings present in 'STR'.

Example:

Input:
"abbc"
Output:
5
Explanation:

The pa...read more

Ans.

Count the total number of palindromic substrings in a given string.

  • Iterate through each character in the string and expand around it to find palindromic substrings.

  • Use dynamic programming to store the results of subproblems to avoid redundant calculations.

  • Consider both odd-length and even-length palindromes while counting.

  • Example: For input 'abbc', the palindromic substrings are ['a', 'b', 'b', 'c', 'bb'], totaling 5.

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

Q5. Power Set Generation

Given a sorted array of 'N' integers, your task is to generate the power set for this array. Each subset of this power set should be individually sorted.

A power set of a set 'ARR' is the s...read more

Ans.

Generate power set of a sorted array of integers with individually sorted subsets.

  • Iterate through all possible combinations using bitwise operations.

  • Sort each subset before adding it to the power set.

  • Handle empty subset separately.

Add your answer

Q6. Pythagorean Triplets Detection

Determine if an array contains a Pythagorean triplet by checking whether there are three integers x, y, and z such that x2 + y2 = z2 within the array.

Input:

The first line contai...read more
Ans.

Detect if an array contains a Pythagorean triplet by checking if there are three integers x, y, and z such that x^2 + y^2 = z^2.

  • Iterate through all possible combinations of three integers in the array and check if x^2 + y^2 = z^2.

  • Use a nested loop to generate all possible combinations efficiently.

  • If a Pythagorean triplet is found, output 'yes', otherwise output 'no'.

Add your answer
Are these interview questions helpful?

Q7. Intersection of Linked List Problem

You are provided with two singly linked lists containing integers, where both lists converge at some node belonging to a third linked list.

Your task is to determine the data...read more

Ans.

Find the node where two linked lists merge, return -1 if no merging occurs.

  • Traverse both lists to find the lengths and the last nodes

  • Align the starting points of the lists by adjusting the pointers

  • Traverse again to find the merging point

Add your answer

Q8. Remove Vowels from a String

Given a string STR of length N, your task is to remove all the vowels from that string and return the modified string.

Input:

The first line of input contains an integer 'T' represen...read more
Ans.

Remove all vowels from a given string and return the modified string.

  • Iterate through each character in the string and check if it is a vowel (a, e, i, o, u or A, E, I, O, U).

  • If the character is not a vowel, add it to the modified string.

  • Return the modified string after processing all characters.

Add your answer
Share interview questions and help millions of jobseekers 🌟

Q9. Find All Pairs Adding Up to Target

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 the Target.

Input:

The first line conta...read more
Ans.

Given an array of integers and a target value, find all pairs of elements that add up to the target.

  • Iterate through the array and for each element, check if the target minus the element exists in a hash set.

  • If it exists, add the pair to the result. If not, add the element to the hash set.

  • Handle cases where the same element is used twice in a pair.

  • Return (-1, -1) if no pair is found.

Add your answer
Q10. How many types of memory areas are allocated by the JVM?
Ans.

JVM allocates 5 types of memory areas: Method Area, Heap, Stack, PC Register, and Native Method Stack.

  • Method Area stores class structures and static variables.

  • Heap is where objects are allocated.

  • Stack holds method-specific data and references.

  • PC Register stores the address of the current instruction being executed.

  • Native Method Stack is used for native method execution.

Add your answer

Q11. Preorder Traversal of a BST Problem Statement

Given an array PREORDER representing the preorder traversal of a Binary Search Tree (BST) with N nodes, construct the original BST.

Each element in the given array ...read more

Ans.

Given a preorder traversal of a BST, construct the BST and return its inorder traversal.

  • Create a binary search tree from the preorder traversal array

  • Return the inorder traversal of the constructed BST

  • Ensure each element in the array is distinct

Add your answer

Q12. Spiral Matrix Path Problem Statement

Given a N x M matrix of integers, print the spiral order of the matrix.

Input:

The input starts with an integer 'T' representing the number of test cases. Each test case con...read more

Ans.

The problem involves printing the spiral order of a given N x M matrix of integers.

  • Iterate through the matrix in a spiral order by keeping track of the boundaries.

  • Print the elements in the order of top row, right column, bottom row, and left column.

  • Continue this process until all elements are printed in the spiral order.

Add your answer

Q13. 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 more
Ans.

This 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

Add your answer
Q14. What are the various access specifiers in Java?
Ans.

Access specifiers in Java control the visibility of classes, methods, and variables.

  • There are four access specifiers in Java: public, private, protected, and default.

  • Public: accessible from any other class.

  • Private: accessible only within the same class.

  • Protected: accessible within the same package and subclasses.

  • Default: accessible only within the same package.

Add your answer
Q15. What is the difference between an abstract class and an interface in OOP?
Ans.

Abstract class can have both abstract and non-abstract methods, while interface can only have abstract methods.

  • Abstract class can have constructors, fields, and methods, while interface cannot have any implementation.

  • A class can implement multiple interfaces but can only inherit from one abstract class.

  • Abstract classes are used to define a common behavior for subclasses, while interfaces are used to define a contract for classes to implement.

  • Example: Abstract class 'Animal' w...read more

Add your answer

Q16. Concatenate the Largest Digit Problem

You are given three non-zero numbers 'A', 'B', and 'C'. Your task is to determine the number created by concatenating the largest digit found in each number, in the sequenc...read more

Ans.

Concatenate the largest digit from three numbers to form a new number.

  • Find the largest digit in each number 'A', 'B', and 'C'.

  • Concatenate the largest digits in the order 'A', 'B', and 'C' to form the new number.

  • Return the final concatenated number as the output.

Add your answer
Q17. What is the purpose of using @ComponentScan in class files?
Ans.

@ComponentScan is used in class files to enable component scanning for Spring beans.

  • Enables Spring to automatically detect and register Spring beans within the specified package(s)

  • Reduces the need for manual bean registration in configuration files

  • Can be used with basePackages attribute to specify the base package for scanning

  • Can also be used with includeFilters and excludeFilters to customize the scanning process

Add your answer
Q18. What are the basic annotations that Spring Boot offers?
Ans.

Spring Boot offers basic annotations like @RestController, @RequestMapping, @Autowired, @Component, @Service, @Repository.

  • @RestController - used to define RESTful web services.

  • @RequestMapping - maps web requests to specific handler methods.

  • @Autowired - used for automatic dependency injection.

  • @Component - marks a Java class as a Spring component.

  • @Service - marks a Java class as a Spring service.

  • @Repository - marks a Java class as a Spring data repository.

Add your answer
Q19. How can you print numbers from 1 to 100 using more than two threads in an optimized approach?
Ans.

Use multiple threads to print numbers from 1 to 100 in an optimized approach.

  • Divide the range of numbers (1-100) among the threads for parallel processing.

  • Use synchronization mechanisms like mutex or semaphore to ensure proper order of printing.

  • Implement a loop in each thread to print their assigned numbers.

  • Example: Thread 1 prints 1-25, Thread 2 prints 26-50, and so on.

  • Ensure proper termination of threads after printing all numbers.

Add your answer
Q20. What are the types of design patterns in Java?
Ans.

Design patterns in Java are reusable solutions to common problems encountered in software design.

  • Creational Patterns: Singleton, Factory, Builder

  • Structural Patterns: Adapter, Decorator, Facade

  • Behavioral Patterns: Observer, Strategy, Template Method

Add your answer

Q21. 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 more
Ans.

Emergency 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.

Add your answer

Q22. 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 more
Ans.

A 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

Add your answer
Q23. What do you know about the JIT compiler?
Ans.

JIT compiler stands for Just-In-Time compiler, which compiles code during runtime instead of ahead of time.

  • JIT compiler improves performance by compiling code on the fly as it is needed

  • It can optimize code based on runtime conditions and platform specifics

  • Examples include Java HotSpot VM's JIT compiler and .NET's JIT compiler

Add your answer
Q24. Why is Java considered platform independent, while the Java Virtual Machine (JVM) is platform dependent?
Ans.

Java is platform independent because it compiles code into bytecode that can run on any platform, while the JVM is platform dependent because it interprets bytecode into machine code specific to the underlying system.

  • Java code is compiled into bytecode, which is a platform-independent intermediate representation of the code.

  • The JVM interprets this bytecode and translates it into machine code that is specific to the underlying platform.

  • This allows Java programs to run on any p...read more

Add your answer
Q25. What is the main difference between UNION and UNION ALL?
Ans.

UNION combines result sets from two or more SELECT statements, while UNION ALL includes all rows, including duplicates.

  • UNION removes duplicate rows, while UNION ALL does not

  • UNION is slower than UNION ALL as it performs a distinct operation

  • UNION requires the same number of columns in the SELECT statements being combined

Add your answer

Q26. how can you improve performance of your spring boot application

Ans.

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

Add your answer

Q27. how did you implement logging in your springboot application

Ans.

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

Add your answer
Q28. What is the difference between Python arrays and lists?
Ans.

Python arrays are a module in Python that allows you to create arrays of a specific data type, while lists are a built-in data structure that can hold elements of different data types.

  • Arrays in Python are created using the 'array' module and can only store elements of the same data type, while lists can store elements of different data types.

  • Arrays are more memory efficient compared to lists as they store data in a contiguous block of memory.

  • Lists have more built-in functions...read more

Add your answer
Q29. How can you retrieve the second highest salary from a database table?
Ans.

Retrieve the second highest salary from a database table

  • Use a SQL query with ORDER BY and LIMIT to retrieve the second highest salary

  • Example: SELECT salary FROM employees ORDER BY salary DESC LIMIT 1, 1

Add your answer
Q30. What do you mean by data encapsulation?
Ans.

Data encapsulation is the concept of bundling data and methods that operate on the data into a single unit or class.

  • Data encapsulation helps in hiding the internal state of an object and restricting access to it.

  • It allows for better control over the data by preventing external code from directly modifying it.

  • Encapsulation also promotes code reusability and modularity by grouping related data and functions together.

  • Example: In object-oriented programming, a class encapsulates ...read more

Add your answer
Q31. How do you delete duplicates from a table in SQL Server?
Ans.

Use a common method like using CTE with ROW_NUMBER() function to delete duplicates from a table in SQL Server.

  • Use a common table expression (CTE) with ROW_NUMBER() function to assign a unique row number to each duplicate record.

  • Delete the duplicate records by filtering out rows with row number greater than 1.

  • Example: WITH CTE AS (SELECT *, ROW_NUMBER() OVER (PARTITION BY column1, column2 ORDER BY column3) AS rn FROM table_name) DELETE FROM CTE WHERE rn > 1;

Add your answer
Q32. Can you explain the difference between setMaxResults() and setFetchSize() in a Query?
Ans.

setMaxResults() limits the number of results returned by a query, while setFetchSize() determines the number of rows fetched at a time from the database.

  • setMaxResults() is used to limit the number of results returned by a query.

  • setFetchSize() determines the number of rows fetched at a time from the database.

  • setMaxResults() is typically used for pagination purposes, while setFetchSize() can improve performance by reducing the number of round trips to the database.

  • Example: setM...read more

Add your answer
Q33. What is the difference between a process and a program?
Ans.

A program is a set of instructions to perform a specific task, while a process is an instance of a program in execution.

  • Program is a static entity stored on disk, while process is a dynamic entity in memory.

  • Program is passive, while process is active and can interact with other processes.

  • Multiple processes can run the same program simultaneously.

  • Example: Notepad.exe is a program, while when you open Notepad, it becomes a process.

Add your answer
Q34. What is pickling and unpickling in Python?
Ans.

Pickling is the process of serializing an object into a byte stream, while unpickling is the process of deserializing the byte stream back into an object in Python.

  • Pickling is used to store Python objects in a file or transfer data over a network.

  • Unpickling is used to retrieve the original Python objects from the stored byte stream.

  • The 'pickle' module in Python is used for pickling and unpickling objects.

  • Example: Pickling a dictionary - pickle.dump(data, file)

  • Example: Unpickl...read more

Add your answer
Q35. What is the difference between the interrupted() and isInterrupted() methods in Java?
Ans.

interrupted() checks if the current thread has been interrupted, while isInterrupted() checks if a thread has been interrupted.

  • interrupted() is a static method in the Thread class, while isInterrupted() is an instance method.

  • interrupted() clears the interrupted status of the current thread, while isInterrupted() does not.

  • Example: boolean interrupted = Thread.interrupted(); // clears interrupted status and returns true if interrupted

Add your answer
Q36. What are the different types of data marts in the context of data warehousing?
Ans.

Data marts are subsets of data warehouses that focus on specific business areas or departments.

  • Types include dependent data marts, independent data marts, and hybrid data marts.

  • Dependent data marts rely on the data warehouse for data, while independent data marts do not.

  • Hybrid data marts combine elements of both dependent and independent data marts.

  • Examples include sales data mart, marketing data mart, and finance data mart.

Add your answer
Q37. What is the difference between a Fact Table and a Dimension Table in a Data Warehouse?
Ans.

Fact Table contains quantitative data and measures, while Dimension Table contains descriptive attributes.

  • Fact Table typically contains numerical data that can be aggregated (e.g. sales revenue, quantity sold)

  • Dimension Table contains descriptive attributes for the data in the Fact Table (e.g. product name, customer details)

  • Fact Table is usually normalized for efficient data storage and retrieval, while Dimension Table is denormalized for easier querying and reporting

Add your answer
Q38. How do you deploy a Big Data model? Please mention the key steps involved.
Ans.

Deploying a Big Data model involves several key steps to ensure successful implementation.

  • Prepare the data for deployment by cleaning and transforming it as needed

  • Choose the appropriate deployment environment such as on-premises or cloud

  • Implement the model using tools like Apache Spark or Hadoop

  • Monitor the performance of the deployed model and make necessary adjustments

  • Scale the deployment as needed to handle increasing data volume

  • Ensure security measures are in place to prot...read more

Add your answer

Q39. 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 more
Ans.

Creating 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.

Add your answer

Q40. 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

Ans.

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.

Add your answer
Q41. What is the difference between a process and a thread?
Ans.

A process is an instance of a program running on a computer, while a thread is a smaller unit of a process that can execute independently.

  • A process has its own memory space, while threads share the same memory space within a process.

  • Processes are heavyweight, requiring separate memory and resources, while threads are lightweight and share resources.

  • Processes communicate with each other through inter-process communication mechanisms, while threads can communicate directly with...read more

Add your answer
Q42. What is the difference between INNER JOIN and OUTER JOIN in SQL?
Ans.

INNER JOIN returns rows when there is at least one match in both tables, while OUTER JOIN returns all rows from both tables.

  • INNER JOIN only returns rows that have matching values in both tables

  • OUTER JOIN returns all rows from both tables, even if there are no matches

  • Types of OUTER JOIN include LEFT JOIN, RIGHT JOIN, and FULL JOIN

  • Example: INNER JOIN would return only the customers who have made a purchase, while OUTER JOIN would return all customers with or without a purchase

Add your answer
Q43. Can you explain the @RestController annotation in Spring Boot?
Ans.

The @RestController annotation in Spring Boot is used to define a class as a RESTful controller.

  • Used to create RESTful web services in Spring Boot

  • Combines @Controller and @ResponseBody annotations

  • Automatically serializes return objects to JSON/XML

  • Maps HTTP requests to handler methods based on @RequestMapping annotations

Add your answer
Q44. What is the difference between CHAR and VARCHAR2 data types in SQL?
Ans.

CHAR is fixed length while VARCHAR2 is variable length in SQL.

  • CHAR stores fixed length strings, padding with spaces if necessary.

  • VARCHAR2 stores variable length strings, only using the necessary space.

  • CHAR is faster for fixed length data, while VARCHAR2 is more flexible and efficient for variable length data.

Add your answer
Q45. Can you explain the ETL process in a data warehouse?
Ans.

ETL process involves extracting data from various sources, transforming it to fit the data warehouse schema, and loading it into the warehouse.

  • Extract: Data is extracted from different sources such as databases, files, APIs, etc.

  • Transform: Data is cleaned, filtered, aggregated, and transformed to match the data warehouse schema.

  • Load: Transformed data is loaded into the data warehouse for analysis and reporting.

  • Example: Extracting customer information from a CRM system, transf...read more

Add your answer
Q46. Can you explain Hadoop and list its core components?
Ans.

Hadoop is an open-source framework for distributed storage and processing of large data sets.

  • Core components include Hadoop Distributed File System (HDFS), Yet Another Resource Negotiator (YARN), and MapReduce.

  • HDFS is responsible for storing data across multiple machines in a Hadoop cluster.

  • YARN manages resources and schedules tasks across the cluster.

  • MapReduce is a programming model for processing and generating large data sets.

  • Other components like Hadoop Common, Hadoop Map...read more

Add your answer

Q47. Write a code to find Number of occurrences of a word in a string

Ans.

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

Add your answer
Q48. What are the features of a lambda expression?
Ans.

Lambda expressions are anonymous functions that can be passed as arguments or returned from methods.

  • Lambda expressions are concise and can be used to represent a single method interface.

  • They do not have a name, return type, or access modifier.

  • They can have zero or more parameters and a body that contains the code to be executed.

  • Lambda expressions can be used in functional interfaces to provide implementation for abstract methods.

  • Example: (x, y) -> x + y is a lambda expression...read more

View 3 more answers
Q49. How do you check how much space is left in the current drive?
Ans.

To check how much space is left in the current drive, you can use the 'df' command in the terminal.

  • Use the 'df' command followed by the '-h' flag to display the disk space in a human-readable format.

  • Look for the 'Available' column to see how much space is left on the current drive.

  • Example: 'df -h' will show you the disk space usage on all mounted filesystems.

Add your answer
Q50. Can you explain the N+1 SELECT problem in Hibernate?
Ans.

N+1 SELECT problem in Hibernate occurs when a query results in N+1 database queries being executed instead of just one.

  • Occurs when a query fetches a collection of entities and then for each entity, another query is executed to fetch related entities individually

  • Can be resolved by using fetch joins or batch fetching to fetch all related entities in a single query

  • Example: Fetching a list of orders and then for each order, fetching the customer information separately

Add your answer
Q51. What are the concurrency strategies available in Hibernate?
Ans.

Hibernate provides several concurrency strategies like optimistic locking, pessimistic locking, and versioning.

  • Optimistic locking: Allows multiple transactions to read and write to the database without locking the data. Conflicts are resolved during transaction commit.

  • Pessimistic locking: Locks the data when it is read, preventing other transactions from modifying it until the lock is released.

  • Versioning: Uses a version number to track changes to entities. When an entity is u...read more

Add your answer

Q52. What is pass by reference and pass by value

Ans.

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.

Add your answer
Q53. What is the use of 'self' in Python?
Ans.

The 'self' keyword in Python is used to refer to the instance of the class itself.

  • Used to access variables and methods within a class

  • Must be the first parameter in a class method definition

  • Helps differentiate between instance variables and local variables

  • Example: class MyClass: def __init__(self, x): self.x = x

  • Example: class MyClass: def display(self): print(self.x)

Add your answer
Q54. What is the __init__ method in Python?
Ans.

The __init__ method is a special method in Python classes used to initialize new objects.

  • The __init__ method is called when a new instance of a class is created.

  • It is used to initialize the attributes of the object.

  • Example: class MyClass: def __init__(self, x): self.x = x obj = MyClass(5)

Add your answer
Q55. How does inheritance work in Python?
Ans.

Inheritance in Python allows a class to inherit attributes and methods from another class.

  • Inheritance is achieved by creating a new class that derives from an existing class.

  • The new class (subclass) can access the attributes and methods of the existing class (superclass).

  • Subclasses can also override or extend the functionality of the superclass.

  • Example: class Dog(Animal) - Dog inherits attributes and methods from Animal class.

Add your answer
Q56. How do you find the second highest salary from a table in SQL?
Ans.

Use a subquery to find the second highest salary in SQL.

  • Use a subquery to select the maximum salary from the table.

  • Then use another subquery to select the maximum salary that is less than the maximum salary found in the first step.

  • Combine both subqueries to get the second highest salary.

Add your answer

Q57. What is the Java code for various types of sorting algorithms?

Ans.

Various sorting algorithms in Java code

  • Bubble Sort: int[] arr = {5, 2, 8, 1, 3}; Arrays.sort(arr);

  • Selection Sort: int[] arr = {5, 2, 8, 1, 3}; Arrays.sort(arr);

  • Insertion Sort: int[] arr = {5, 2, 8, 1, 3}; Arrays.sort(arr);

  • Merge Sort: int[] arr = {5, 2, 8, 1, 3}; Arrays.sort(arr);

  • Quick Sort: int[] arr = {5, 2, 8, 1, 3}; Arrays.sort(arr);

Add your answer
Q58. What is dependency injection?
Ans.

Dependency injection is a design pattern where components are given their dependencies rather than creating them internally.

  • Allows for easier testing by providing mock dependencies

  • Promotes loose coupling between components

  • Improves code reusability and maintainability

  • Examples: Constructor injection, Setter injection, Interface injection

Add your answer
Q59. How can you run a selected test from a group of tests in Cucumber?
Ans.

You can run a selected test from a group of tests in Cucumber by using tags.

  • Add tags to the scenarios you want to run

  • Use the --tags option when running Cucumber to specify which tags to include/exclude

  • Example: cucumber --tags @smokeTest

Add your answer
Q60. How do you find all the processes that have opened a file in Linux?
Ans.

To find all processes that have opened a file in Linux, you can use the lsof command.

  • Use the lsof command followed by the file path to see which processes have opened the file.

  • You can also use the -t option with lsof to only display the process IDs.

  • To find all processes that have opened any file in a specific directory, use lsof +D /path/to/directory.

Add your answer
Q61. What are the advantages of using Packages in Java?
Ans.

Packages in Java help organize code, prevent naming conflicts, and provide access control.

  • Organize code into logical groups for easier maintenance and readability

  • Prevent naming conflicts by using unique package names

  • Provide access control by using package-private, protected, public modifiers

  • Facilitate reusability by allowing classes in the same package to access each other's members

Add your answer
Q62. What is the difference between an Array and an ArrayList in C#?
Ans.

An Array is a fixed-size collection of elements of the same type, while an ArrayList is a dynamic collection that can grow or shrink in size.

  • Arrays are fixed in size, while ArrayLists can dynamically resize.

  • Arrays can only store elements of the same type, while ArrayLists can store elements of different types.

  • Arrays are faster for accessing elements, while ArrayLists are slower due to boxing and unboxing.

  • Arrays are strongly typed, while ArrayLists are not and require casting ...read more

Add your answer
Q63. What is the difference between a Test Stub and a Test Driver?
Ans.

Test Stub is a simulated module used in place of a real module, while Test Driver is a program that calls the module being tested.

  • Test Stub is used to simulate the behavior of a module that the module under test depends on.

  • Test Driver is used to invoke the module being tested and pass test cases to it.

  • Test Stub is used when the dependent module is not yet developed or is unavailable.

  • Test Driver is used to automate the testing process by providing inputs and checking outputs.

  • E...read more

Add your answer
Q64. What do you mean by a degenerate dimension?
Ans.

A degenerate dimension is a dimension that consists of attributes that are stored in the fact table instead of a separate dimension table.

  • Degenerate dimensions are typically used for attributes that are not easily categorized or do not have enough distinct values to warrant a separate dimension table.

  • Examples of degenerate dimensions include order numbers, invoice numbers, and transaction IDs.

  • These attributes are often used for grouping or filtering data within the fact table...read more

Add your answer

Q65. Singleton can be broken by cloning, how to prevent it?

Ans.

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.

Add your answer

Q66. When a function is passed as an argument to another function. Then it is a callback function

Ans.

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; });

Add your answer

Q67. What is intial sql, how and when do you write catom sql in tableau, what is cat in sql...and some project related questions

Ans.

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.

Add your answer
Q68. Why should Selenium be selected as a testing tool for web applications or systems?
Ans.

Selenium is a popular testing tool for web applications due to its flexibility, compatibility with multiple browsers, and robust features.

  • Selenium supports multiple programming languages such as Java, Python, and C#, making it versatile for different teams and projects.

  • It can automate testing across various browsers like Chrome, Firefox, and Safari, ensuring consistent results across different platforms.

  • Selenium offers a wide range of features for web testing, including the a...read more

Add your answer
Q69. What does it mean when a file has 644 permissions in Linux?
Ans.

File with 644 permissions in Linux means read and write access for owner, and read-only access for group and others.

  • Owner can read and write the file

  • Group and others can only read the file

  • Permissions are represented as three sets of three bits (rwx)

Add your answer
Q70. What is a pipe in operating systems, and when is it used?
Ans.

A pipe in operating systems is a form of inter-process communication that allows the output of one process to be used as the input of another process.

  • A pipe is a method for passing data between processes in a unidirectional manner.

  • It is typically used when the output of one process needs to be input into another process.

  • Pipes are created using the pipe() system call in Unix-like operating systems.

  • An example of using a pipe is when using the 'ls | grep' command in a Unix shell...read more

Add your answer
Q71. Can you explain briefly how Behavioral Driven Development (BDD) works?
Ans.

BDD is a software development process that encourages collaboration between developers, QA, and non-technical stakeholders.

  • BDD focuses on defining the behavior of a system through examples in plain language

  • Uses a common language (like Gherkin syntax) to create executable specifications

  • Tests are written in a way that they can be easily understood by non-technical team members

  • Promotes communication and collaboration among team members to ensure everyone has a shared understandi...read more

Add your answer
Q72. Can you explain the JUnit annotations that are linked with Selenium?
Ans.

JUnit annotations like @Before, @Test, @After are commonly used with Selenium for test automation.

  • Annotations like @Before are used to set up preconditions before each test method.

  • Annotations like @Test are used to mark a method as a test method.

  • Annotations like @After are used to clean up after each test method.

  • Annotations like @Ignore are used to skip a test method.

  • Annotations like @RunWith are used to specify a custom test runner.

Add your answer
Q73. Can you explain the storage unit in Hadoop, specifically HDFS?
Ans.

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.

Add your answer

Q74. How are 4-5 microservices connected in rest api's? which technique you are using?

Ans.

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

Add your answer

Q75. Are you aware of DevOp? How to use in producing output for client?

Ans.

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

View 1 answer

Q76. what is oop concept, difference b/w interface and abstract class

Ans.

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

Add your answer

Q77. How to creat web page by using html and css

Ans.

To create a web page using HTML and CSS, you need to write the structure and content in HTML and then style it using CSS.

  • Start by creating the basic structure of the web page using HTML tags such as <html>, <head>, <title>, <body>, <header>, <footer>, <nav>, <section>, <article>, <div>, etc.

  • Add content to the web page using text, images, links, and other elements within the HTML tags.

  • Use CSS to style the web page by selecting elements with selectors and applying styles such a...read more

Add your answer

Q78. How many times we use for loop in single program

Ans.

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.

Add your answer
Q79. How do you take a backup of a table in MySQL?
Ans.

To take a backup of a table in MySQL, you can use the mysqldump command.

  • Use the mysqldump command followed by the database name and table name to backup a specific table.

  • Specify the username and password for the MySQL database when using mysqldump.

  • You can also backup multiple tables or the entire database using mysqldump.

  • Save the backup file in a secure location for future restoration if needed.

Add your answer
Q80. Can you explain what a thread pool is?
Ans.

A thread pool is a collection of worker threads that are managed by the system to efficiently execute tasks.

  • Thread pools help improve performance by reusing threads instead of creating new ones for each task.

  • They limit the number of concurrent threads to prevent resource exhaustion.

  • Thread pools can be used in applications like web servers to handle multiple client requests efficiently.

Add your answer
Q81. What are Java 8 streams?
Ans.

Java 8 streams are a sequence of elements that support functional-style operations.

  • Streams allow for processing sequences of elements in a functional way.

  • They can be created from various data sources like collections, arrays, or I/O channels.

  • Common operations on streams include map, filter, reduce, and collect.

  • Example: List<String> names = Arrays.asList("Alice", "Bob", "Charlie"); Stream<String> stream = names.stream();

  • Example: int sum = numbers.stream().filter(n -> n % 2 == ...read more

View 3 more answers

Q82. write the queries to find out nth and 3rd highest record

Ans.

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

Add your answer
Ans.

CGI is a leading global IT and business consulting services firm.

  • CGI has a strong reputation in the industry for delivering high-quality software solutions.

  • CGI offers a wide range of opportunities for career growth and development.

  • CGI has a global presence, allowing for exposure to diverse projects and clients.

  • CGI values innovation and encourages employees to think creatively.

  • CGI provides a supportive and collaborative work environment.

View 1 answer
Q84. Can you explain the Software Testing Life Cycle (STLC)?
Ans.

STLC is a systematic process for testing software applications from planning to closure.

  • STLC involves planning, designing, executing, and reporting on tests.

  • Phases include requirement analysis, test planning, test design, test execution, and closure.

  • Each phase has specific deliverables and goals to ensure quality software.

  • Example: In requirement analysis, testers review requirements to identify test scenarios.

Add your answer
Q85. How do you automate the testing of CAPTCHA?
Ans.

Automating CAPTCHA testing involves using tools like Selenium, OCR, and machine learning algorithms.

  • Use Selenium to interact with the CAPTCHA element on the webpage.

  • Integrate Optical Character Recognition (OCR) tools to read and interpret the CAPTCHA image.

  • Implement machine learning algorithms to train models to solve CAPTCHAs.

  • Use browser automation tools like Puppeteer to automate the entire process.

  • Consider using third-party CAPTCHA solving services if necessary.

View 1 answer

Q86. What is the application that is better than Spark in AWS?

Ans.

AWS Glue is an application that is better than Spark in AWS.

  • AWS Glue is a fully managed extract, transform, and load (ETL) service that makes it easy to prepare and load data for analytics.

  • It provides a serverless environment for running ETL jobs and supports various data sources and destinations.

  • AWS Glue also offers automatic schema discovery, data cataloging, and data transformation capabilities.

  • It integrates well with other AWS services like Amazon S3, Amazon Redshift, and...read more

View 1 answer
Q87. What are some important Crontab commands used in Linux?
Ans.

Crontab commands are used in Linux for scheduling tasks at specific times.

  • crontab -e: Edit the crontab file

  • crontab -l: List the current crontab entries

  • crontab -r: Remove the current crontab file

  • crontab -u username: Specify the username whose crontab is to be modified

  • */5 * * * * command: Run 'command' every 5 minutes

Add your answer

Q88. How to write excute parameters in function

Ans.

Execute parameters in a function must be an array of strings.

  • Define the function with parameters in the parentheses

  • Separate each parameter with a comma

  • Enclose the parameters in square brackets to create an array

  • Example: function myFunction([param1, param2, param3]) { //code here }

Add your answer

Q89. 1. what are the components of selenium? 2. different web locators in selenium? 3. command to select the dropdown? 4. code to launch the Brower etc...

Ans.

Selenium components, web locators, dropdown selection, and browser launch code.

  • Selenium components include Selenium IDE, Selenium WebDriver, and Selenium Grid.

  • Web locators in Selenium include ID, Name, Class Name, Tag Name, Link Text, and Partial Link Text.

  • To select a dropdown, use the Select class and its methods like selectByVisibleText(), selectByValue(), and selectByIndex().

  • To launch a browser, use the WebDriver interface and its methods like get() and navigate().

Add your answer

Q90. Explain Spring Cloud and how you are using in microservices?

Ans.

Spring Cloud is a set of tools and frameworks for building cloud-native applications in Java.

  • Spring Cloud provides tools for service discovery, load balancing, configuration management, and more in microservices architecture.

  • It includes projects like Eureka for service discovery, Ribbon for client-side load balancing, and Config Server for externalized configuration.

  • Spring Cloud integrates with Spring Boot to simplify the development of distributed systems.

  • Using Spring Cloud,...read more

Add your answer

Q91. name two design pattern used in project

Ans.

Two common design patterns used in projects are Singleton and Observer patterns.

  • Singleton pattern ensures a class has only one instance and provides a global point of access to it.

  • Observer pattern defines a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.

Add your answer

Q92. What are different keywords in gherkin?,write a script for given scenario, what is backend testing, java basic questions

Ans.

Answering questions related to Senior Test Engineer interview

  • Different keywords in Gherkin include Given, When, Then, And, But

  • Example script for scenario: Given I am on the login page, When I enter valid credentials, Then I should be redirected to the dashboard

  • Backend testing involves testing the server-side components of an application

  • Java basic questions may include concepts like OOPs, exception handling, and data structures

Add your answer
Q93. Can you explain the Singleton pattern?
Ans.

Singleton pattern ensures a class has only one instance and provides a global point of access to it.

  • Used to restrict the instantiation of a class to one object

  • Commonly used in scenarios where only one instance of a class is needed, such as database connections or configuration settings

  • Implemented by creating a static method that returns the same instance of the class every time it is called

Add your answer
Q94. Can you explain briefly how Behavioral Driven Development works?
Ans.

Behavioral Driven Development (BDD) is a software development process that encourages collaboration between developers, testers, and business stakeholders.

  • BDD focuses on defining the behavior of a system through examples in plain text

  • Scenarios are written in a specific format called Gherkin, which uses keywords like Given, When, and Then

  • These scenarios serve as both documentation and automated tests

  • BDD helps ensure that the development team is building the right features and ...read more

Add your answer
Q95. Can you enlist the basic components of Linux?
Ans.

Basic components of Linux include kernel, shell, commands, utilities, and file system.

  • Kernel - core component that manages hardware resources

  • Shell - interface for users to interact with the system

  • Commands - instructions given to the system for specific tasks

  • Utilities - additional tools for system management

  • File system - structure for organizing and storing data

Add your answer
Q96. What is meant by normalization and denormalization?
Ans.

Normalization is the process of organizing data in a database to reduce redundancy and improve data integrity. Denormalization is the opposite process.

  • Normalization involves breaking down data into smaller, more manageable tables to reduce redundancy and dependency.

  • Denormalization involves combining tables to improve query performance by reducing the number of joins needed.

  • Normalization helps maintain data integrity by reducing the risk of anomalies such as update, insert, an...read more

Add your answer

Q97. What is a vector how is it different from array

Ans.

A vector is a dynamic array that can resize itself, while an array has a fixed size.

  • Vectors can grow or shrink in size dynamically, while arrays have a fixed size.

  • Vectors can easily insert or remove elements at any position, while arrays require shifting elements.

  • Vectors provide bounds checking and can be passed by value, while arrays cannot.

  • Example: vector names = {"Alice", "Bob", "Charlie"};

Add your answer

Q98. 1. WAP to count the no of vowels in a given string using hash map . 2 . String related program. 3. Selenium basic 4 . Rest assured .

Ans.

Count the number of vowels in a given string using a hash map.

  • Create a hash map to store the count of each vowel (a, e, i, o, u) in the string.

  • Iterate through the string and update the count in the hash map for each vowel encountered.

  • Finally, sum up the counts of all vowels in the hash map to get the total number of vowels in the string.

Add your answer

Q99. Unique and primary key Clustered vs non cluster index Store proc

Ans.

The question covers database concepts like unique and primary keys, clustered and non-clustered indexes, and stored procedures.

  • A unique key is a column or set of columns that uniquely identifies each row in a table.

  • A primary key is a unique key that also enforces data integrity rules.

  • A clustered index determines the physical order of data in a table, while a non-clustered index does not.

  • Stored procedures are precompiled SQL statements that can be executed multiple times.

Add your answer

Q100. sql query for seleting a particular column from a table and give the employer count

Ans.

Use SQL query to select a particular column from a table and get the count of entries.

  • Use SELECT statement to specify the column you want to retrieve.

  • Use COUNT() function to get the count of entries in that column.

  • Combine both in a single query to achieve the desired result.

Add your answer
1
2
3
4

More about working at CGI Group

Top Rated Company for Women - 2024
Top Rated IT/ITES Company - 2024
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at Aker Solutions

based on 414 interviews
Interview experience
4.1
Good
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Interview Questions from Similar Companies

3.4
 • 650 Interview Questions
4.0
 • 471 Interview Questions
3.9
 • 409 Interview Questions
4.6
 • 159 Interview Questions
4.1
 • 141 Interview Questions
4.0
 • 137 Interview Questions
View all
Top CGI Group Interview Questions And Answers
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

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