Ernst & Young (EY) interview experience Real time questions & tips from candidates to crack your interview

Associate Software Engineer

Ernst & Young (EY)
upvote
share-icon
3 rounds | 15 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 4 Months
Topics: Data Structures, Algorithms, JavaScript, HTML, CSS, Aptitude, OOPS
Tip
Tip

Tip 1 : Must do Previously asked Interview as well as Online Test Questions.
Tip 2 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 3 : Do at-least 2 good projects and you must know every bit of them.

Application process
Where: Campus
Eligibility: Above 7 CGPA
Resume Tip
Resume tip

Tip 1 : Have at-least 2 good projects explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more.

Interview rounds

01
Round
Medium
Video Call
Duration60 Minutes
Interview date29 Apr 2021
Coding problem7

This round had 2 coding questions where in I was first asked to explain my approach and then code the solution . After
that , I was asked some more questions on OOPS and JavaScript.

1. Intersection of Linked List

Easy
25m average time
73% success
0/40
Asked in companies
OracleThought WorksIBM

You are given two Singly Linked Lists of integers, which may have an intersection point.

Your task is to return the first intersection node. If there is no intersection, return NULL.


Example:-
The Linked Lists, where a1, a2, c1, c2, c3 is the first linked list and b1, b2, b3, c1, c2, c3 is the second linked list, merging at node c1.

alt.txt

Problem approach

Approach :
1) Calculate the length of both the lists, say len1 and len2

2) Get the absolute difference of the lengths, diff = |len1 – len2|

3) Now traverse the long list from the first node till ‘diff’ nodes so that from there onwards both the lists have equal
number of nodes

4) Then traverse both the lists in parallel and check whether a common node is reached (Note that getting a common
node is done by comparing the address of the nodes, not the data)
4.1) If yes, return that node’s data
4.2) If no, return -1


TC : O(N) , where N = max length of the linked list
SC : O(1)

Try solving now

2. Pythagorean Triplets

Moderate
35m average time
70% success
0/80
Asked in companies
AmazonOYOErnst & Young (EY)

You are given an array of n integers (a1, a2,....,an), you need to find if the array contains a pythagorean triplet or not.

An array is said to have a pythagorean triplet if there exists three integers x,y and z in the array such that x^2 + y^2 = z^2.

Note
1. The integers x,y and z might not be distinct , but they should be present at different locations in the array i.e if a[i] = x, a[j] = y and a[k] = z, then i,j and k should be pairwise distinct.
2. The integers a,b and c can be present in any order in the given array.
Problem approach

Approach :
1) I solved it in O(N^2) approach.
2) Sort the array.
3) Initially map all the elements of the array to their index in a Hash Map or a Hash Set.
4) Now , run 2 for loops and for every x^2 + y^2 ,check if there exists a z^2 s.t x^2+y^2=z^2 and the index of z^2 is
different than both the indices of x and y.

Try solving now

3. OOPS Question

What do you mean by data encapsulation?

Problem approach

1) Data Encapsulation is an Object-Oriented Programming concept of hiding the data attributes and their behaviors in
a single unit.

2) It helps developers to follow modularity while developing software by ensuring that each object is independent of
other objects by having its own methods, attributes, and functionalities.

3) It is used for the security of the private properties of an object and hence serves the purpose of data hiding.

4. OOPS Question

Can the static methods be overridden?

Problem approach

1) No. Declaration of static methods having the same signature can be done in the subclass but run time
polymorphism can not take place in such cases.

2) Overriding or dynamic polymorphism occurs during the runtime, but the static methods are loaded and looked up
at the compile time statically. Hence, these methods cant be overridden.

5. Java Question

What is Garbage collector in JAVA?

Problem approach

1) Garbage Collection in Java is a process by which the programs perform memory management automatically.

2) The Garbage Collector(GC) finds the unused objects and deletes them to reclaim the memory. I

3) In Java, dynamic memory allocation of objects is achieved using the new operator that uses some memory and the
memory remains allocated until there are references for the use of the object.

4) When there are no references to an object, it is assumed to be no longer needed, and the memory, occupied by
the object can be reclaimed.

5) There is no explicit need to destroy an object as Java handles the de-allocation automatically.
The technique that accomplishes this is known as Garbage Collection. Programs that do not de-allocate memory can
eventually crash when there is no memory left in the system to allocate. These programs are said to have memory
leaks.


Garbage collection in Java happens automatically during the lifetime of the program, eliminating the need to de-
allocate memory and thereby avoiding memory leaks.

In C language, it is the programmer’s responsibility to de-allocate memory allocated dynamically using free()
function.This is where Java memory management leads.

6. Javascript Question

Explain Hoisting in JavaScript.

Problem approach

Hoisting is a default behaviour of javascript where all the variable and function declarations are moved on top.
This means that irrespective of where the variables and functions are declared, they are moved on top of the scope.
The scope can be both local and global.

EXAMPLE 1 :

hoistedVariable = 10;
console.log(hoistedVariable); // outputs 10 even when the variable is declared after it is initialized
var hoistedVariable;


EXAMPLE 2 :

hoistedFunction(); // Outputs " Hello world! " even when the function is declared after calling

function hoistedFunction(){
console.log(" Hello world! ");
}


EXAMPLE 3 :

// Hoisting takes place in the local scope as well
function doSomething(){
x = 33;
console.log(x);
var x;
}

7. JavaScript Question

What are closures?

Problem approach

A closure is the combination of a function and the lexical environment within which that function was declared. i.e, It is
an inner function that has access to the outer or enclosing function’s variables. The closure has three scope chains

i) Own scope where variables defined between its curly brackets
ii) Outer function’s variables
iii) Global variables

Let's take an example of closure concept,

function Welcome(name){
var greetingInfo = function(message){
console.log(message+' '+name);
}
return greetingInfo;
}
var myFunction = Welcome('John');
myFunction('Welcome '); //Output: Welcome John
myFunction('Hello Mr.'); //output: Hello Mr.John


As per the above code, the inner function(i.e, greetingInfo) has access to the variables in the outer function scope(i.e,
Welcome) even after the outer function has returned.

02
Round
Medium
Video Call
Duration60 Minutes
Interview date29 Apr 2021
Coding problem7

This round was mainly inclined towards some Frontend Web Development questions(as I had told the interviewer that I have some prior experince in that field and also have some projects supporting this) ranging from HTML,CSS to JavaScript.

1. JavaScript Question

Explain promises and it's 3 states .

Problem approach

1) A promise is an object that may produce a single value some time in the future: either a resolved value, or a
reason that it’s not resolved (e.g., a network error occurred).

2) A promise may be in one of 3 possible states: fulfilled, rejected, or pending. Promise users can attach callbacks to
handle the fulfilled value or the reason for rejection.

3) Promises are eager, meaning that a promise will start doing whatever task we give it as soon as the promise
constructor is invoked.


Working of Promises :

A promise is an object which can be returned synchronously from an asynchronous function. It will be in one of 3
possible states:

i) Fulfilled: onFulfilled() will be called (e.g., resolve() was called)
ii) Rejected: onRejected() will be called (e.g., reject() was called)
iii) Pending: not yet fulfilled or rejected

1) A promise is settled if it’s not pending (it has been resolved or rejected). Sometimes people use resolved and
settled to mean the same thing: not pending.

2) Once settled, a promise can not be resettled. Calling resolve() or reject() again will have no effect. The immutability
of a settled promise is an important feature.

3) Native JavaScript promises don’t expose promise states. Instead, you’re expected to treat the promise as a black
box.

4) Only the function responsible for creating the promise will have knowledge of the promise status, or access to
resolve or reject.


Important Promise Rules : Promises following the spec must follow a specific set of rules :

1) A promise or “thenable” is an object that supplies a standard-compliant .then() method.

2) A pending promise may transition into a fulfilled or rejected state.

3) A fulfilled or rejected promise is settled, and must not transition into any other state.

4) Once a promise is settled, it must have a value (which may be undefined). That value must not change.

5) Change in this context refers to identity (===) comparison. An object may be used as the fulfilled value, and object
properties may mutate.

2. JavaScript Question

What is a higher order function?

Problem approach

Higher-order function is a function that accepts another function as an argument or returns a function as a return
value or both.

EXAMPLE :

const firstOrderFunc = () => console.log ('Hello, I am a First order function');
const higherOrder = ReturnFirstOrderFunc => ReturnFirstOrderFunc();
higherOrder(firstOrderFunc);

3. Swap Two Numbers

Easy
10m average time
0/40
Asked in companies
CIS - Cyber InfrastructureErnst & Young (EY)Cybage Software

You are given two numbers 'a' and 'b' as input.


You must swap the values of 'a' and 'b'.


For Example:
Input: 
'a' = 8, 'b' = 5

Output:
5 8

Explanation:
Initially, the value of 'a' and 'b' is 8 and 5, respectively.

After swapping, the value of 'a' is 5, and the value of 'b' is 8.
Problem approach

Approach 1 (Using Destructruring Assignment) : This method was specific only for JS and the interviewer was preety
impressed when I used it .

Destructuring assignment (a feature of ES2015) lets you extract items of an array into variables. It works with any
data type: numbers, strings, booleans, objects.

Code :

let a = 1;
let b = 2;
[a, b] = [b, a];
a; // => 2
b; // => 1

[a, b] = [b, a] is the destructuring assignment that swaps the variables a and b.


Approach 2 (Normal Method - Using a temporary variable - Not recommended in interviews though) :

Code :

let a = 1;
let b = 2;
let temp;
temp = a;
a = b;
b = temp;
a; // => 2
b; // => 1

temp is the temporary variable.
At the first step, temp is assigned with the value of a. Then a variable is assigned with the value of b. Finally, the
variable b is assigned with the value of temp (having the initial value of a).


Approach 3 (Without using temporary variable - Using Addition and Difference) :

Code :

let a = 1;
let b = 2;
a = a + b;
b = a - b;
a = a - b;
a; // => 2
b; // => 1

Initially, a is 1 and b is 2. Let's see how the 3 statements perform the swapping:

a = a + b assigns to a the value 1 + 2.
b = a - b assigns to b the value 1 + 2 - 2 = 1 (b is now 1).
a = a - b assigns to a the value 1 + 2 - 1 = 2 (a is now 2).

Finally, a is 2 and b is 1. The swapping of a and b has been performed.

Try solving now

4. HTML Question

What are the features of HTML-5?

Problem approach

HTML stands for Hypertext Markup Language, and it is the standard markup language for creating web pages and
web applications. HTML5 is the 5th version of HTML.

Some of the new features that were added in HTML5 that make it better than HTML are as follows :

1) Intro of audio and video : Audio and Video tags are the two major addition to HTML5. It allows developers to
embed a video or audio on their website. HTML5 video can use CSS and CSS3 to style the video tag.


2) Vector Graphics : This is a new addition to the revised version which has hugely impacted the use of Adobe Flash
in websites. It can be used to draw graphics with various shapes and colors via scripting usually JS. Vector graphics
are scalable, easy to create and edit. It also supports interactivity and animation.


3) Header and Footer : With these new tags, there is no longer a need to identify the two elements with a tag.
Footer is placed at the end of the web page while Header is placed at the start of the web page. By using 
and HTML5 elements, the browser will know what to load first and what to load later.

The header can contain-
i) One or more heading elements ( – )
ii) Logo or icon
iii) Authorship information

Footer can contain-
i) Authorship information
ii) Copyright information
iii) Contact information
iv) Back to top links


4) Figure and Figcaption : HTML5 allows to use a element to mark up a photo in a document, and a
element to define a caption for the photo. The tag defines a caption for a element.
This tag provides a container for content that is equivalent to a figure.


5) Nav tag : The tag defines a set of navigation links. It is used for the part of an internet site that links to
different pages at the website. The hyperlinks can be organized through a number of approaches. Common
examples of the nav elements are menus, tables, contents, and indexes.

5. HTML Question

How to optimize website assets loading?

Problem approach

To optimize website load time we need to optimize its asset loading and for that : 

1) CDN hosting - A CDN or content delivery network is geographically distributed servers to help reduce latency.

2) File compression - This is a method that helps to reduce the size of an asset to reduce the data transfer

3) File concatenation - This reduces the number of HTTP calls

4) Minify scripts - This reduces the overall file size of js and CSS files

5) Parallel downloads - Hosting assets in multiple subdomains can help to bypass the download limit of 6 assets per domain of all modern browsers. This can be configured but most general users never modify these settings.

6) Lazy Loading - Instead of loading all the assets at once, the non-critical assets can be loaded on a need basis.

6. CSS Question

In how many ways you can display HTML elements?

Problem approach

1) inline: Using this we can display any block-level element as an inline element. The height and width attribute values of the element will not affect.

2) block: using this, we can display any inline element as a block-level element. 

3) inline-block: This property is similar to inline, except by using the display as inline-block, we can actually format the element using height and width values.

4) flex: It displays the container and element as a flexible structure. It follows flexbox property.

5) inline-flex: It displays the flex container as an inline element while its content follows the flexbox properties.

6) grid: It displays the HTML elements as a grid container.

7) none: Using this property we can hide the HTML element.

7. CSS Question

What is a z-index, how does it function?

Problem approach

z-index is used for specifying the vertical stacking of the overlapping elements that occur at the time of its positioning. It specifies the vertical stack order of the elements positioned that helps to define how the display of elements should happen in cases of overlapping.

The default value of this property is 0 and can be either positive or negative. Apart from 0, the values of the z-index can be:

1) Auto: The stack order will be set equal to the parent.
2) Number: The number can be positive or negative. It defines the stack order.
3) Initial: The default value of 0 is set to the property.
4) Inherit: The properties are inherited from the parent.

The elements having a lesser value of z-index is stacked lower than the ones with a higher z-index.

03
Round
Easy
HR Round
Duration30 Minutes
Interview date29 Apr 2021
Coding problem1

This was a typical HR round with some standard Behavioral questions like my interests, weaknesses, strengths, family
background, are you willing to relocate or travel , why Ernst & Young, CEO of Ernst & Young etc.

1. Basic HR Question

Why should we hire you ?

Problem approach

Tip 1 : The cross questioning can go intense some time, think before you speak.

Tip 2 : Be open minded and answer whatever you are thinking, in these rounds I feel it is important to have opinion.

Tip 3 : Context of questions can be switched, pay attention to the details. It is okay to ask questions in these round,
like what are the projects currently the company is investing, which team you are mentoring. How all is the work
environment etc.

Tip 4 : Since everybody in the interview panel is from tech background, here too you can expect some technical
questions. No coding in most of the cases but some discussions over the design can surely happen.

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

How do you remove whitespace from the start of a string?

Choose another skill to practice
Similar interview experiences
company logo
Associate Software Engineer
3 rounds | 2 problems
Interviewed by Ernst & Young (EY)
2775 views
0 comments
0 upvotes
company logo
Associate Software Engineer
3 rounds | 2 problems
Interviewed by Ernst & Young (EY)
1470 views
0 comments
0 upvotes
company logo
Associate Software Engineer
2 rounds | 2 problems
Interviewed by Ernst & Young (EY)
1433 views
0 comments
0 upvotes
company logo
Analyst
3 rounds | 4 problems
Interviewed by Ernst & Young (EY)
2196 views
1 comments
0 upvotes
Companies with similar interview experiences
company logo
Associate Software Engineer
4 rounds | 9 problems
Interviewed by NCR Corporation
1512 views
0 comments
0 upvotes
company logo
Associate Software Engineer
2 rounds | 3 problems
Interviewed by CIS - Cyber Infrastructure
598 views
0 comments
0 upvotes
company logo
Associate Software Engineer
3 rounds | 7 problems
Interviewed by CIS - Cyber Infrastructure
624 views
0 comments
0 upvotes