Tip 1 : Practice coding question of array, string, hashmap, stack, queue
Tip 2 : Do atleast 2 projects
Tip 1 : Have some projects on resume.
Tip 2 : Do not put false things on resume.
A program P reads in 500 integers in the range [0..100] exepresenting the scores of 500 students. It then prints the frequency of each score above 50. What would be the best way for P to store the frequencies?
A. An array of 50 numbers
B. An array of 100 numbers
C. An array of 500 numbers
D. A dynamically allocated array of 550 numbers
Option 1 : An array of 50 numbers
There are 500 students, the score range is 0 to 100.
Print the frequency of those student whose score is above 50.
So frequency range contains score from 50 to 100, so an array of 50 numbers is suitable for representing the frequency.
Consider an array A[20, 10], assume 4 words per memory cell and the base address of array A is 100. What is the address of A[11, 5] ? Assume row major storage.
A. 560
B. 565
C. 570
D. 575
Option - A =>560 is the correct answer. Explanation : The formula to find the address of A[i][j] or A[11][5] using the row major form is given below => Address of A[i][j] = B + W* [N* (i -Lr) + (j -Lc) ]
The process to find the location of the record with the given key value is called ___
A) Traversing
B) Sorting
C) Searching
D) Deletion
C) Searching: Algorithms are designed to check for an element or retrieve an element from any data structure where it is stored. Therefore finding the location of the element with a given value is Search
An algorithm is a ___ procedure in the normal English language for solving a particular problem.
A) Random
B) Complicated
C) Both A and B
D) Step by step
Ans) D. Step by step



Paragraph = ‘It's a square SqUare. It's a FLAT flat.’
Banned =[FLAT, IT, S].
So we can see these words [IT, S, SQUARE, FLAT ] are most frequent.
Now we will look at to banned list and we can see 3 of the words are banned.
So we have a unique answer SQUARE which has a frequency of 2 and not on the banned list.
Follow the steps to solve the problem:
Create a count array of size 256 to store the frequency of every character of the string
Maintain a max variable to store the maximum frequency so far whenever encounter a frequency more than max then update max
And update that character in our result variable.



Consider if ‘N’ = 4, the Factorial of 4 will be the product of all numbers from 1 to 4, which is 1 * 2 * 3 * 4 = 24. Hence, the answer is 24.
Using For loop
Follow the steps to solve the problem:
Using a for loop, we will write a program for finding the factorial of a number.
An integer variable with a value of 1 will be used in the program.
With each iteration, the value will increase by 1 until it equals the value entered by the user.
The factorial of the number entered by the user will be the final value in the fact variable



Naive Approach: The simplest approach to solve this problem is to generate all possible permutations and for each permutation, check if all the elements are not placed in their original position. If found to be true, then increment the count. Finally, print the count.
What is Java?
Advantages of Java
What is JDK, JVM, JRE?
Why Java is platform-independent?
Define public static void main(String args[])
Access specifiers
What is the value of a variable when we initialize it?
What is Object-Oriented programming?
What is constructor?
What is Polymorphism?
What is Abstraction?
Difference between abstraction and interface?
How to achieve all features of Oops in Java?
What is Data Structure?
What is Stack?
What is Queue?
What is sorting?
Which sorting algorithm is best?
Time complexity of Quick sort and why its best?
Merge Sort.
What is Database?
What is Normalization?
What is the concepts of key in DBMS? How many types of keys are in DBMS?
What is the difference between Primary key and unique key?
What is join in SQL?
This is a formality. You won’t be rejected unless you make a blunder during the interview. The interviewer will mark you on various skills which you filled in the form before the 2nd round and check that you filled the form seriously or not.
Explain your strengths and weaknesses.
Why do u want to join nagarro.
How many rejections have u faced before?
Being from ECE why u wanted a job in its sector.
Comfortable with shifts and relocation.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
How do you remove whitespace from the start of a string?