## Recent Interview Questions

More Questions »- 0of 0 votes
Define a class Marks as having the fields marks1, marks2, marks3 and maxMarks all of type int.

In the class Marks

- define a constructor of the class whch takes 3 ints as input and assigns them to marks1, marks2 and mark3 respectively. It aslo assigns the maximum of marks1, marks2 and marks3 to maxMarks.

- define a method getMaxMarks() which returns the maximum of marks1, marks2 and marks3.

- define a method isPass() which returns true if the average of marks1, marks2 and marks3 is at least 40.

Define a class StudentList which has the field allMarks(of type Marks[]). In the class, define the methods

- totalStudents() which returns the number of total students which is the number of objects in the array allMarks

- passCount() which returns the number of students who have passed.

- 0of 0 votes
Define a class Point having 2 fields x (int) and y (int) which represents a point (x,y)

Define a class Line having 2 Points, pt1 and pt2.

Define a class Quadrilateral having 4 Points, pt1, pt2, pt3 and pt4. The class also has the following functions

- getAllLines() which returns a Line[] consisting all 4 lines of the Quadrilateral. Note that the 4 lines of the quadrilateral will be pt1:pt2, pt2:pt3, pt3:pt4 and pt4:pt1

- longestSide() which return a Line that represents the longest the side of the Quadrilateral.

Also define the constructors for each class

- -1of 1 vote
Define a class Marks as having the fields marks1, marks2, marks3 and maxMarks all of type int.

In the class Marks

- define a constructor of the class whch takes 3 ints as input and assigns them to marks1, marks2 and mark3 respectively. It aslo assigns the maximum of marks1, marks2 and marks3 to maxMarks.

- define a method getMaxMarks() which returns the maximum of marks1, marks2 and marks3.

- define a method isPass() which returns true if the average of marks1, marks2 and marks3 is at least 40.

Define a class StudentList which has the field allMarks(of type Marks[]). In the class, define the methods

- totalStudents() which returns the number of total students which is the number of objects in the array allMarks

- passCount() which returns the number of students who have passed.

- 0of 0 votes
They conducted a hiring round and this was asked there ?

Hi friends This question was asked in recent hiring challenge at hackerearth , that is over now,Please discuss your strategies.I am not able to devise algorithm please provide some hints to solve it.

Pulkit is really good at maths. Recently, he came to know about a problem on matrices. Amazed by the problem he got, he asked Ashish the same problem. Ashish also being good at maths solved the problem within 5 minutes. Now, its your time to solve the problem.

You will be given n*m binary matrix. You need to tell if it is possible to delete a column such that after deleting that column, rows of the matrix will be unique. If yes than print "Yes" else print "No".

[Input]

First line contains an integer t denoting no.of test cases.

Next line contains 2 integers n and m denoting no.of rows and columns.

Next n line contains binary string of length m each.

[Output]

For each test case output "Yes" or "No".

[Constraints]

1<=t<=100

1<=n<=1000

2<=m<=1000

Sample Input (Plaintext Link)

2

3 3

101

000

100

2 2

11

11

Sample Output (Plaintext Link)

Yes

No

- 0of 0 votes
Given a 2-dimensional array with arbitrary sizes and contains random positive values, you are required to move from the first element [0][0] to the last element [n][n] using the path which will yield the maximum sum of all the elements traversed. You can only move right and down; NOT left and up.