CGI Group
300+ Aker Solutions Interview Questions and Answers
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
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
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 N
th step. The height of each step is provided...read more
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.
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
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.
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
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.
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
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.
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
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'.
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
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
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
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.
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
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.
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.
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
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
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
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.
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 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
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.
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
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
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.
@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
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.
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.
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
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 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.
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 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
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
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
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
Q26. 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
Q27. 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
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
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
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
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;
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
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.
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
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
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.
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
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
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 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.
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
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.
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
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
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
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.
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
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
Q47. 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
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
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.
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
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
Q52. 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.
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)
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)
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.
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.
Q57. What is the Java code for various types of sorting algorithms?
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);
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
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
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.
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
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
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
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
Q65. 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.
Q66. 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; });
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
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.
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
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)
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
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
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.
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.
Q74. 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
Q75. 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
Q76. 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
Q77. How to creat web page by using html and css
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
Q78. 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.
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.
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.
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
Q82. 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
Q83. Why CGI?
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.
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.
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.
Q86. What is the application that is better than Spark in AWS?
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
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
Q88. How to write excute parameters in function
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 }
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...
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().
Q90. Explain Spring Cloud and how you are using in microservices?
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
Q91. name two design pattern used in project
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.
Q92. What are different keywords in gherkin?,write a script for given scenario, what is backend testing, java basic questions
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
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
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
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
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
Q97. What is a vector how is it different from array
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"};
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 .
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.
Q99. Unique and primary key Clustered vs non cluster index Store proc
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.
Q100. sql query for seleting a particular column from a table and give the employer count
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.
More about working at CGI Group
Top HR Questions asked in Aker Solutions
Interview Process at Aker Solutions
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month