Capgemini Engineering
300+ Midas Safety Interview Questions and Answers
Q1. Sort an Array of 0's, 1's, and 2's Problem Statement
Given an integer array ARR
of size 'N' containing only the values 0, 1, and 2, the task is to sort this array.
The goal is to achieve the sorting in a single...read more
Q2. Detect Cycle in a Linked List
Given a singly linked list of integers, determine whether it contains a cycle. A cycle exists if any node in the list can be traversed more than once, forming a loop.
Input:
The fi...read more
Q3. Remove All Occurrences of a Character from a String
Given a string str
and a character 'X', write a function to remove all occurrences of 'X' from the given string.
If the character 'X' doesn't exist in the inp...read more
Q4. Linked List Cycle Detection
Determine if a given singly linked list of integers forms a cycle.
Explanation:
A cycle in a linked list occurs when a node's next reference points back to a previous node in the lis...read more
Q5. Reverse a Linked List Problem Statement
You are given a Singly Linked List of integers. Your task is to reverse the Linked List by changing the links between nodes.
Input:
The first line of input contains a sin...read more
Q6. Merge Sort Problem Statement
You are given a sequence of numbers, ARR
. Your task is to return a sorted sequence of ARR
in non-descending order using the Merge Sort algorithm.
Explanation:
The Merge Sort algorit...read more
Q7. Level Order Traversal of Binary Tree
Given a binary tree of integers, return its level order traversal.
Input:
The first line contains an integer 'T' which represents the number of test cases. For each test cas...read more
Q8. String to Pascal Case Conversion
Given a string STR
, the goal is to remove all spaces from the string and convert it to Pascal case. In Pascal case, there are no spaces between words, and each word begins with ...read more
Q9. Delete Nth Node from End in a Linked List
Given a singly linked list with integer data and an integer K
, write a function to remove the Kth node from the end of the linked list.
Example:
Input:
The linked list ...read more
Q10. Quick Sort Problem Statement
You are provided with an array of integers. The task is to sort the array in ascending order using the quick sort algorithm.
Quick sort is a divide-and-conquer algorithm. It involve...read more
Q11. What are Hooks in React? Name the ones you have used in your project.
Hooks are a feature introduced in React 16.8 that allow developers to use state and other React features in functional components.
useState() - for managing state in functional components
useEffect() - for performing side effects in functional components
useContext() - for accessing context in functional components
useReducer() - for managing complex state and actions in functional components
useCallback() - for memoizing functions in functional components
useMemo() - for memoizing...read more
Q12. Factorial Calculation Problem Statement
Develop a program to compute the factorial of a given integer 'n'.
The factorial of a non-negative integer 'n', denoted as n!
, is the product of all positive integers les...read more
Q13. Reverse a String Problem Statement
Given a string STR
containing characters from [a-z], [A-Z], [0-9], and special characters, determine the reverse of the string.
Input:
The input starts with a single integer '...read more
Q14. What are Higher Order Functions and Higher Order Components. Give examples.
Higher Order Functions are functions that take other functions as arguments or return functions as their results.
Higher Order Functions can be used to create reusable code by abstracting common functionality into a separate function.
They can also be used to implement functional programming concepts like currying and composition.
Example: Array.prototype.map() is a higher order function that takes a callback function as an argument and applies it to each element of an array, re...read more
Q16. How does Event Loop works? What are Event Queue and Event Stack?
Event Loop is a mechanism that allows JavaScript to handle asynchronous operations.
Event Loop is a continuous process that checks the Event Queue and moves events to the Event Stack.
Event Queue holds all the events that are waiting to be processed.
Event Stack holds the events that are currently being processed.
When the Event Stack is empty, the Event Loop checks the Event Queue for new events.
JavaScript uses Event Loop to handle asynchronous operations like setTimeout(), setI...read more
Q17. What have you done on real implementation on linux OS?
I have implemented various software applications on Linux OS.
Developed a web application using Python Flask framework on Linux server
Created a custom Linux kernel module for a hardware device driver
Implemented a distributed system using Apache Kafka on Linux machines
Optimized performance of a database server running on Linux by tuning kernel parameters
Q18. What is microprocessor and explain register names?
A microprocessor is a computer processor that incorporates the functions of a central processing unit on a single integrated circuit.
Microprocessors are used in various electronic devices such as computers, smartphones, and gaming consoles.
Register names include program counter (PC), accumulator (ACC), general-purpose registers (GPR), and memory address register (MAR).
Registers are used to store data and instructions temporarily for processing.
The number of registers and thei...read more
Q19. What is difference between C and C++?
C++ is an extension of C with object-oriented programming features.
C++ supports object-oriented programming while C does not.
C++ has classes and templates while C does not.
C++ has better support for exception handling than C.
C++ has a standard library while C does not.
C++ allows function overloading while C does not.
Q20. What is difference between array and linked list?
Arrays are contiguous blocks of memory while linked lists are made up of nodes that point to the next node.
Arrays have fixed size while linked lists can grow dynamically.
Insertion and deletion are faster in linked lists than in arrays.
Arrays have better cache locality while linked lists have better memory utilization.
Arrays are accessed using indices while linked lists are accessed using pointers.
Examples of arrays include int[] and char[] while examples of linked lists inclu...read more
Q21. Explain whole process for Example.c file to Example.exe conversion
The process of converting Example.c file to Example.exe involves several steps.
Preprocessing: includes header file inclusion, macro expansion, and conditional compilation
Compilation: converts source code to object code
Linking: combines object code with libraries to create executable file
Debugging: identifying and fixing errors in code
Optimization: improving performance of executable file
Q22. Say your house is at Position X and You’re currently at position Y which is 3 kms away from your home and you have a car and a cycle for you to take home. You have to take both of them anyhow as the place is no...
read moreQ23. What is data abstraction and explain with code?
Data abstraction is the process of hiding implementation details and showing only necessary information.
Abstraction is achieved through abstract classes and interfaces.
It helps in reducing complexity and increasing efficiency.
Example: abstract class Shape with abstract method draw() implemented by its subclasses like Circle and Rectangle.
Q24. I am working on multiple language so how you are comfortable to work on multiple language
I am comfortable working with multiple languages and have experience in doing so.
I have experience working with languages such as Java, Python, C++, and JavaScript.
I am able to quickly adapt to new languages and learn them efficiently.
I understand the importance of proper documentation and commenting in code to ensure readability for others.
I have worked on projects that required integration of multiple languages, such as a web application with a backend in Python and a front...read more
Q32. Difference between Let, Const and Var. Write code and explain.
Let, Const, and Var are used to declare variables in JavaScript with different scoping and reassignment abilities.
Var has function scope and can be redeclared and reassigned.
Let has block scope and can be reassigned but not redeclared.
Const has block scope and cannot be reassigned or redeclared.
Q33. How can you optimize a React App?
Optimizing a React app involves reducing bundle size, using lazy loading, and optimizing rendering performance.
Reduce bundle size by code splitting and using dynamic imports
Use lazy loading to load components only when needed
Optimize rendering performance by using shouldComponentUpdate and PureComponent
Use React.memo to memoize functional components
Avoid unnecessary re-renders by using useMemo and useCallback
Use performance profiling tools like React DevTools and Chrome DevTo...read more
Q34. 1. What is the difference between ipV4 and IPv6? 2. What is TCP/IP? 3. What is TCP/IP 3 way handshake? 4. Questions related to minor projects which I have done in B.Tech.
Q35. Write a code by which you can find the no. of same train no. Occurrence in a snapshot from a database in railway ticketing system?
Use a code to count the occurrence of the same train number in a snapshot from a railway ticketing database.
Iterate through the snapshot data and store the train numbers in a hashmap with their counts
Return the hashmap with train numbers as keys and their occurrence counts as values
Q36. What is array ? What is constructor ? What is difference between class and object ?
Array is a collection of similar data types. Constructor is a special method used to initialize objects. Class is a blueprint while object is an instance of a class.
Array is used to store multiple values in a single variable.
Constructor is called when an object of a class is created.
Class defines the properties and methods of an object while object is an instance of a class.
Example of array: int[] numbers = {1, 2, 3};
Example of constructor: public class Car { public Car() { /...read more
Q37. What is prelayout signal integrity? How will you do that
Prelayout signal integrity is the analysis of signal quality before the layout of a printed circuit board.
It involves simulating the behavior of signals on a PCB before the actual layout is done.
The goal is to identify potential signal integrity issues and correct them before the layout is finalized.
Tools such as SPICE simulators and electromagnetic field solvers are used for prelayout signal integrity analysis.
Factors such as trace length, impedance, and crosstalk are consid...read more
Q39. Write a SQL query to join two tables?
SQL query to join two tables
Use JOIN keyword to combine two tables based on a common column
Specify the columns to be selected using SELECT keyword
Use ON keyword to specify the common column between two tables
Q40. If I remove the pointer from main argument like In case of main(int argc, char *argv[]) it will main(int argc, char argv[]) then what is the effect?
Removing the pointer from main argument changes the way the program accesses command line arguments.
Without the pointer, the program will need to access each character individually in the argv array.
This can lead to errors and make the code more complex to handle.
For example, instead of argv[0], you would need to access argv[0][0], argv[0][1], etc.
Q41. How can you access any function from main function which is written in a header file without including the header file in C?
You can access functions from a header file in C without including it by declaring the functions as extern in the main file.
Declare the function prototypes as extern in the main file.
Link the object file generated from the header file with the main file during compilation.
Access the functions from the header file in the main file without including the header file.
Q42. WAP for recursion and explain its working?
Recursion is a technique where a function calls itself to solve a problem. WAP for recursion is to write a program using recursion.
Recursion is used to solve problems that can be broken down into smaller sub-problems.
The base case is the condition where the function stops calling itself.
The recursive case is where the function calls itself with a smaller input.
Example: Factorial of a number can be calculated using recursion.
Example: Fibonacci series can be generated using rec...read more
Q45. how many ways we can find the element on page in selenium
There are multiple ways to find elements on a page in Selenium, including by ID, name, class name, tag name, link text, partial link text, XPath, and CSS selector.
By ID: driver.findElement(By.id("elementId"))
By name: driver.findElement(By.name("elementName"))
By class name: driver.findElement(By.className("className"))
By tag name: driver.findElement(By.tagName("tagName"))
By link text: driver.findElement(By.linkText("linkText"))
By partial link text: driver.findElement(By.partia...read more
Q47. Which service needs to run to connect to other unified communication applications.
The service that needs to run to connect to other unified communication applications is the Session Initiation Protocol (SIP).
Session Initiation Protocol (SIP) is a signaling protocol used for initiating, maintaining, modifying, and terminating real-time sessions involving video, voice, messaging, and other communications applications.
SIP is commonly used in Voice over IP (VoIP) systems and allows for the establishment and control of multimedia communication sessions.
By runni...read more
Q48. Where to take logs when one iphone not able to call other.
Logs should be taken from the network devices involved in the call flow.
Check logs on the caller's iPhone
Check logs on the recipient's iPhone
Check logs on the network devices (routers, switches) involved in the call flow
Look for any error messages or anomalies in the logs
Analyze the logs to identify any network issues or misconfigurations
Q49. How do you check/verify the IBIS models?
IBIS models can be verified by comparing simulation results with actual measurements.
Compare simulation results with actual measurements
Use a variety of test cases to ensure accuracy
Verify the model's compliance with IBIS standards
Check for consistency with other models and datasheets
Q52. What is the difference between C, C++ and Java ?
C is a procedural language, C++ is an object-oriented language, and Java is a class-based object-oriented language.
C is a low-level language with limited abstraction and no built-in support for object-oriented programming.
C++ is an extension of C with added support for object-oriented programming, templates, and exception handling.
Java is a high-level language with automatic memory management, platform independence, and a large standard library.
C and C++ are compiled language...read more
Q53. What is the difference between JVM, JDK and JRE?
JVM is a virtual machine that executes Java bytecode. JDK is a development kit that includes JRE and tools for developing Java applications. JRE is a runtime environment that executes Java bytecode.
JVM stands for Java Virtual Machine and is responsible for executing Java bytecode.
JDK stands for Java Development Kit and includes JRE along with tools for developing Java applications.
JRE stands for Java Runtime Environment and provides a runtime environment for executing Java by...read more
Q54. What is software engineering. Tell all the steps involved in it?
Q55. What is testing, what are different types of testing?
Q59. What are state and props. Difference.
State and props are two important concepts in React. State represents the internal data of a component, while props are used to pass data from a parent component to a child component.
State is mutable and can be changed within a component.
Props are read-only and cannot be modified within a component.
State is used to manage component-specific data, while props are used for inter-component communication.
State is initialized and managed within a component, while props are passed ...read more
Q60. What is connection less and connection oriented protocol and their implementation
Q61. What is TCP/IP,OSI model?
TCP/IP is a protocol used for communication between devices on the internet. OSI model is a conceptual framework for network communication.
TCP/IP is a suite of protocols that governs communication between devices on the internet.
OSI model is a conceptual framework that divides network communication into seven layers.
TCP/IP is based on a four-layer model, which includes the application, transport, internet, and network access layers.
The OSI model includes the physical, data li...read more
Q62. What is program counter?
Program counter is a register that stores the memory address of the next instruction to be executed by the processor.
Program counter is also known as instruction pointer.
It is a part of the processor's control unit.
The value of program counter is incremented after each instruction is executed.
If a program counter is corrupted, the processor may execute incorrect instructions.
Example: If the program counter is pointing to memory address 100, the next instruction to be executed...read more
Q65. What is switching. Explain and draw the packet switching and circuit switching
Switching is the process of connecting devices in a network.
Packet switching breaks data into packets and sends them individually through the network.
Circuit switching establishes a dedicated communication path between two devices.
Packet switching is more efficient and flexible than circuit switching.
Examples of packet-switched networks include the Internet and Ethernet.
Examples of circuit-switched networks include traditional telephone networks.
Q66. How to get unique elements from list
To get unique elements from a list, use set() function.
Convert the list to a set using set() function
Convert the set back to list using list() function
Example: list(set(['apple', 'banana', 'apple', 'orange'])) will return ['apple', 'banana', 'orange']
Q67. What is Scheduling. Explain different types of scheduling
Q68. Do you know what is the near, far, and huge pointer?
Q73. Difference between Local and Session Storage
Local Storage is persistent storage that remains even after the browser is closed, while Session Storage is temporary and is cleared when the browser is closed.
Local Storage has no expiration date, while Session Storage is cleared when the session ends
Local Storage can store larger amounts of data compared to Session Storage
Local Storage is accessible across different browser tabs and windows, while Session Storage is limited to the current tab or window
Local Storage can be a...read more
Q74. What are the disadvantages of Frame 9FA Gas turbine.
Disadvantages of Frame 9FA gas turbine include high maintenance costs, lower efficiency compared to newer models, and environmental concerns.
High maintenance costs due to complex design and aging components
Lower efficiency compared to newer gas turbine models, resulting in higher fuel consumption
Environmental concerns such as emissions of greenhouse gases and pollutants
Limited flexibility in terms of load following capabilities
Noise and vibration issues during operation
Q75. Write a code for launching 100 windows and select a particular window from opened tabs
Launch 100 windows and select a particular window from opened tabs
Use a loop to launch 100 windows
Keep track of each window's handle or identifier
Use the handle or identifier to select the desired window
Q76. write a code for sorting the elements in array and result should be without duplicates
Code to sort array elements without duplicates
Use a Set to store unique elements while iterating through the array
Convert the Set back to an array for the final result
Use Array.sort() method to sort the elements in the array
Q77. Single linked list operations ( adding and deleting a node)
Single linked list operations involve adding and deleting nodes in a linear data structure.
To add a node, create a new node and set its next pointer to the current head, then set the head to the new node.
To delete a node, traverse the list until the node to be deleted is found, then set the previous node's next pointer to the node after the one being deleted.
Be careful to handle edge cases such as adding to an empty list or deleting the head node.
Q78. What is Ethical Hacking because it is given as my interest?
Q83. Do you use console to locate elements in a web page?
Yes, I use console to locate elements in a web page for debugging and testing purposes.
Yes, I use console commands like document.querySelector() or document.getElementById() to locate elements on a web page.
Console is helpful for quickly testing and verifying element selectors before implementing them in automated tests.
Using console to locate elements can help in identifying issues with element selection and improve test script efficiency.
Q84. Do you use the console to locate elements in web page?
Yes, I use the console to locate elements in web pages for debugging and testing purposes.
I use the console to inspect elements and identify unique attributes like IDs, classes, or XPath.
I can use commands like document.getElementById(), document.querySelector(), or $() to locate elements.
I also use the console to test CSS selectors and verify if elements are being correctly identified.
Q86. Why is Linux preferred over Wi dows for Server
Linux is preferred over Windows for servers due to its stability, security, flexibility, and cost-effectiveness.
Linux is open-source, allowing for customization and flexibility in server configurations.
Linux is known for its stability and reliability, making it a popular choice for servers that require constant uptime.
Linux has a strong focus on security, with regular updates and a large community of developers actively working to address vulnerabilities.
Linux is cost-effecti...read more
Q87. What are all the tools you worked on?
I have worked on various hardware tools including oscilloscopes, logic analyzers, multimeters, and soldering irons.
Oscilloscopes
Logic analyzers
Multimeters
Soldering irons
Q88. How to delete CTL and ITL files from phone.
To delete CTL and ITL files from a phone, access the phone's settings, navigate to the security or device administration section, and delete the files.
Access the phone's settings
Navigate to the security or device administration section
Locate the CTL and ITL files
Delete the files
Q91. Difference between Promise and Async-Await?
Promise is a callback function that returns a value in the future. Async-Await is a syntax that simplifies working with Promises.
Promises are used to handle asynchronous operations and avoid callback hell.
Async-Await is a syntax that allows writing asynchronous code that looks like synchronous code.
Async-Await is built on top of Promises and uses the same underlying mechanism.
Async-Await can only be used within an async function.
Async-Await can handle errors using try-catch b...read more
Q92. What is Hoisting in JS?
Hoisting is a JavaScript behavior where variable and function declarations are moved to the top of their scope.
Hoisting applies to both variable and function declarations.
Variable declarations are hoisted but not their initializations.
Function declarations are fully hoisted, including their definitions.
Hoisting can lead to unexpected behavior if not understood properly.
Q93. JCL code to execute cobol-db2 program? What if dynamic called program is completed with nodynam option? Situation based questions on sort?
To execute a COBOL-DB2 program using JCL code, include the necessary job control statements and specify the program name and input/output files.
Include job control statements like JOB, EXEC, and DD statements in the JCL code.
Specify the program name in the EXEC statement, along with any necessary parameters.
Define input and output files using DD statements.
If the dynamic called program is completed with the 'nodynam' option, it means that the program will not be dynamically c...read more
Q94. Explain about the different layers in OSI model.
The OSI model has 7 layers that define how data is transmitted over a network.
Layer 1: Physical layer - deals with the physical aspects of transmitting data
Layer 2: Data link layer - responsible for error-free transfer of data between nodes
Layer 3: Network layer - manages the routing of data between nodes
Layer 4: Transport layer - ensures reliable delivery of data between applications
Layer 5: Session layer - establishes and manages connections between applications
Layer 6: Pre...read more
Q95. What are k values ? What is neighborship criteria in eigrp ? How to inject default route ? What is acl, prefix list, routemap ?
Answers to questions related to network engineering concepts.
k values are used in EIGRP to calculate the metric of a route
Neighborship criteria in EIGRP is the set of conditions that must be met for two routers to become neighbors
Default route can be injected into EIGRP using the 'ip default-network' command
ACL (Access Control List) is used to filter network traffic based on source/destination IP address, port number, etc.
Prefix list is used to filter routes based on their pr...read more
Q96. Write a code to allocate a memory for multidimential array on heap
Code to allocate memory for multidimensional array on heap
Use malloc() function to allocate memory on heap
Calculate the total size of the array using the dimensions
Use a pointer to access the array elements
Q97. Write a program for banking management system and Railway management System?
Q98. Write a program to remove the character from given input For eg. If input is C:>myprog Irshad s Output should be: Irhad
Top HR Questions asked in Midas Safety
Interview Process at Midas Safety
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month