Ernst & Young
10+ Groei Infotech Interview Questions and Answers
Q1. Intersection of Linked List Problem Statement
You are provided with two singly linked lists of integers. These lists merge at a node of a third linked list.
Your task is to determine the data of the node where ...read more
Given two linked lists, find the node where they intersect, if any.
Traverse both lists to find their lengths and the difference in lengths
Move the pointer of the longer list by the difference in lengths
Traverse both lists in parallel until they meet at the intersection node
Q2. 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.
Return 'yes' if a Pythagorean triplet is found, otherwise return 'no'.
Q3. Swap Two Numbers Problem Statement
Given two integers a
and b
, your task is to swap these numbers and output the swapped values.
Input:
The first line contains a single integer 't', representing the number of t...read more
Swap two numbers 'a' and 'b' and output the swapped values.
Create a temporary variable to store one of the numbers before swapping
Swap the values of 'a' and 'b' using the temporary variable
Output the swapped values as 'b' followed by 'a'
Example: If 'a' = 3 and 'b' = 4, after swapping 'a' will be 4 and 'b' will be 3
Promises in JavaScript represent the eventual completion or failure of an asynchronous operation.
Promises are objects that represent the eventual completion or failure of an asynchronous operation.
They have three states: pending, fulfilled, or rejected.
A pending promise is one that is not yet settled, a fulfilled promise is one that has been resolved successfully, and a rejected promise is one that has encountered an error.
Promises are commonly used for handling asynchronous ...read more
Q5. What is the difference between arrays and linked list. Which one is better
Arrays are fixed in size and have contiguous memory, while linked lists are dynamic and have non-contiguous memory.
Arrays have constant time access to elements, while linked lists have linear time access.
Arrays are better for random access and searching, while linked lists are better for insertion and deletion.
Arrays use less memory for storing elements, while linked lists use more memory due to additional pointers.
Example: Array - ['apple', 'banana', 'cherry'], Linked List -...read more
Optimizing website asset loading involves minimizing file sizes, reducing server requests, utilizing caching, and prioritizing critical resources.
Minimize file sizes by compressing images and scripts
Reduce server requests by combining CSS and JS files, using sprites for images, and lazy loading non-essential resources
Utilize browser caching to store static assets locally for faster loading times
Prioritize critical resources such as above-the-fold content to load first for bet...read more
Data encapsulation is the concept of bundling data with the methods that operate on that data within a 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 direct access from outside the class.
Encapsulation also helps in achieving data abstraction, where only relevant details are exposed to the user.
For example, in a class representing a bank account, the account balance ...read more
There are multiple ways to display HTML elements, including inline, block, inline-block, and flex.
Inline elements flow in a line with other elements and do not start on a new line. Example: <span>
Block elements start on a new line and take up the full width available. Example: <div>
Inline-block elements are similar to inline elements but can have block-level properties. Example: <img>
Flex elements use the flexbox layout model for more advanced control over layout. Example: <d...read more
No, static methods cannot be overridden in Java.
Static methods belong to the class itself, not to instances of the class.
Subclasses can define static methods with the same signature as the superclass, but it is not considered overriding.
Example: Parent class has a static method 'display()', and child class also has a static method 'display()'. These are two separate methods, not overriding.
Garbage collector in Java is a built-in mechanism that automatically manages memory by reclaiming unused objects.
Garbage collector runs in the background to identify and remove objects that are no longer needed.
It helps prevent memory leaks and optimize memory usage.
Examples of garbage collectors in Java include Serial, Parallel, CMS, and G1.
Hoisting in JavaScript is a behavior where variable and function declarations are moved to the top of their containing scope during the compilation phase.
Variable declarations are hoisted to the top of their scope, but not their assignments.
Function declarations are fully hoisted, meaning they can be called before they are declared.
Hoisting can lead to unexpected behavior if not understood properly.
HTML5 is the latest version of the HTML standard with new features for web development.
Support for multimedia elements like <video> and <audio>
Canvas and SVG for graphics and animations
Improved form controls and validation
Offline storage capabilities with local storage and web storage
Geolocation support for location-based services
A higher order function is a function that can take other functions as arguments or return functions as results.
Higher order functions can be used to create more flexible and reusable code.
Examples include map, filter, and reduce functions in JavaScript.
Higher order functions are commonly used in functional programming.
Closures in JavaScript are functions that have access to variables from their outer scope even after the outer function has finished executing.
Closures allow for maintaining state in JavaScript functions.
They are created whenever a function is defined within another function.
Closures can access variables from their outer scope, even after the outer function has returned.
Example: function outerFunction() { let outerVar = 'I am outer'; return function innerFunction() { console....read more
Q15. What are OOPs Concepts?
OOPs Concepts are fundamental principles of Object-Oriented Programming that help in organizing and designing code.
Encapsulation: Bundling data and methods that operate on the data into a single unit (object).
Inheritance: Allowing a class to inherit properties and behavior from another class.
Polymorphism: Ability of objects to take on multiple forms or have multiple behaviors.
Abstraction: Hiding the complex implementation details and showing only the necessary features of an ...read more
Q16. What is AVL tree?
AVL tree is a self-balancing binary search tree where the heights of the two child subtrees of any node differ by at most one.
AVL tree was named after its inventors Adelson-Velsky and Landis.
It is a type of binary search tree where the heights of the two child subtrees of any node differ by at most one.
AVL trees are used to maintain a balanced tree structure, ensuring O(log n) time complexity for insertion, deletion, and search operations.
Rotations are performed on AVL trees ...read more
Q17. Share your college experienceon coding.
I gained hands-on coding experience through coursework, projects, and internships during my college years.
Took courses in programming languages such as Java, C++, and Python.
Participated in coding competitions and hackathons to enhance my skills.
Completed coding projects in areas like web development, data analysis, and software engineering.
Interned at a tech company where I worked on real-world coding projects.
Collaborated with classmates on coding assignments and group proj...read more
Q18. Define LIFO, FIFO etc
LIFO stands for Last In, First Out and FIFO stands for First In, First Out.
LIFO: Last In, First Out - the last item added to a stack is the first one to be removed.
FIFO: First In, First Out - the first item added to a queue is the first one to be removed.
More about working at Ernst & Young
Top HR Questions asked in Groei Infotech
Interview Process at Groei Infotech
Top Associate Software Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month