CGI Group
300+ Dhabriya Polywood 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
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
Q3. 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
Q4. 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
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
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
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
Q8. 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
Q9. 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
Q10. 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
Q12. 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
Q13. 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
Q15. 1,Diff bwn aggregation and composition? 2,w a p to print fibnoci sries? with recursion? 3,Diff bwn interface and abstract? 4,w ap to print * patteren? * ** *** **** 5,Explain custom immutable class? 6,what is i...
read moreThis JSON contains answers to interview questions for a Software Engineer position.
Aggregation and composition are both forms of association in object-oriented programming.
Aggregation represents a 'has-a' relationship, where one object contains another object as a part.
Composition is a stronger form of aggregation, where the lifetime of the contained object is controlled by the container object.
Fibonacci series can be printed using recursion by defining a recursive function t...read more
Q22. 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.
Q24. 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
Q31. 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
Q32. 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
Q40. 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.
Q41. 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.
Q48. 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
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.
Q53. 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);
Q61. 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.
Q63. 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; });
Q68. 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.
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.
Q72. 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
Q73. 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
Q78. 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
Q79. 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
Q80. 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.
Q84. 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
Q85. 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.
Q90. 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
Q92. 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 }
Q93. 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().
Q94. 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
Q95. 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.
Q96. 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
More about working at CGI Group
Top HR Questions asked in Dhabriya Polywood
Interview Process at Dhabriya Polywood
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month