0% found this document useful (0 votes)
15 views10 pages

Sample Interview Questions

The document contains sample interview questions for Java programming, SQL databases, and aptitude tests. It includes coding exercises for string length calculation, grade calculation based on scores, and jump distance problems, along with theoretical questions on OOP concepts and database normalization. Additionally, it lists various database schema requirements for different management systems.

Uploaded by

Prajwal m
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views10 pages

Sample Interview Questions

The document contains sample interview questions for Java programming, SQL databases, and aptitude tests. It includes coding exercises for string length calculation, grade calculation based on scores, and jump distance problems, along with theoretical questions on OOP concepts and database normalization. Additionally, it lists various database schema requirements for different management systems.

Uploaded by

Prajwal m
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Sample Interview Questions (2022)

JAVA
Question 1:
The function countthestring() accepts a parameter string inp_string. Completing the
function countthestring() by returning the number of characters in the string in
integer format.
Example 1
Input:
inp_string=hello
Output:
5
Example 2
Input:
inp_string=banana
Output:
6

The above-mentioned example is a sample test case for your understanding. The
program will be tested on other secret test cases in the backend. Make sure you click
the SAVE AND NEXT button to save and submit your answer
//write your code here-
class Solution{
public int countthestring(String inp_string) {
int string_length=0;
//Write your code here without removing the exisitng code
//the variable inp_string contains the input
//the variable string_length should contain the output
return string_length;
}
}

www.kodnest.com 8095000123
Questions 2:
Harold is building an app that calculates the grade based on the aggregate percentage
of a student. The percentage is computed based on 5 subjects-Physics, Chemistry,
Biology, Mathematics and Computer. Help Harold to calculate grade according to
given conditions:

If percentage >= 90% : Grade S


If percentage >= 80 \% : Grade A
If percentage >= 70 \% : Grade B
If percentage >= 60% : Grade C
If percentage >= 40 \% : Grade D
If percentage < 40% : Grade E
The function calculate grade() accepts the parameter int scores[] Complete the
function calculate grade() by returning the grade for the given scores in string format.

Example 1
Input
scores [95,95,97,98,90]
Output
S
Example 2
Input
scores 140,95,40,60,75]
output-
C
The above mentioned example is a sample test case for your understanding. The
program will be tested on other secret test cases in the backend. Make sure you click
the SUBMIT button to save and submit your answer.
class Solution{
public String calculate grade (int scores[]){
String grade="null";
//Write your code here
//where scores[] contains the input scores

www.kodnest.com 8095000123
//grade should contain the output of the program
return grade ;
}
}
Question 3:
A power jumper has the capability to increase his strength every time he takes a jump.
When he takes consecutive jumps, he starts with a single unit distance jump and every
next jump in the forward direction has the added strength (i.e. distance) of his
previous two jumps.
Every next jump in the backward direction has a strength (i.e. distance) of 1 unit.
If he turns his directions, he loses all his concentration and strength. He is standing at
a lane having a wall at its start and end. If at an instant, he is at the start of the lane
and starts jumping consecutively, how many jumps will it take for him to reach X units
distance from the start?
The function calculate_steps() accepts the parameters int total_length and int
distance_to_reach.Complete the function by returning the number of steps taken in
an integer format.
Note:
He can jump only backwards and forwards.
Example 1:
Input:
Total_length=4,distance_to_reach=2
Output-
2
Explanation:
He will jump from 0 to 1, then from 1 to 2. So, a total of 2 jumps.
Example 2:
Input:
total length 9,distance_to_reach-61
Output:
5
Explanation:
He will jump from 0 to 1, then from 1 to 2, then 2 to 4, then 4 to 7, and then 7 to 6. So,
a total of 5 jumps.

www.kodnest.com 8095000123
The above-mentioned example is a sample test case for your understanding. The
program will be tested on other secret test cases in the backend. Make sure you click
the SAVE AND NEXT button to save and submit your answer.
class Solution{
public int calculate_steps (int total_length, int distance_to_reach){
int steps taken=0;
//Write your code here
//where total_length and distance_to_reach contains input
//steps taken should contain the output of the program
return steps_taken;
}
}

1. What are OOPS concepts in java? Explain with example.


2. What is association in java? And what are the types of association? Explain with
example.
3. What are constructors?
4. What is the use of constructors?
5. What is method overloading?
6. What is constructor overloading?
7. What is difference between overloading and overriding?
8. What is exception handling? Explain with example.
DATABASE (SQL)
1. What is normalization?
2. What is de-normalization?
3. What is data independence?
4. What is data redundancy and how it can be reduced?
5. What are the different types of relationships in DBMS?
6. What is functional dependency?
7. What are attributes?
8. What are the different types of joins?
9. Write a DataBase Schema for Hospital Management System

www.kodnest.com 8095000123
10. Write a DataBase Schema for Bank Management System
11. Write a DataBase Schema for Hotel Management System
12. Write a DataBase Schema for Library Management System
13. Write a DataBase Schema for Electricity Bill Management System
14. Write a DataBase Schema for Blood Bank Management System

APTITUDE
Which of the following boxes should replace the question mark (?) to complete the
pattern?

Puzzles

www.kodnest.com 8095000123
Paper folding

syllogism

www.kodnest.com 8095000123
Logical graphs

average

www.kodnest.com 8095000123
Mirror images

Puzzles

www.kodnest.com 8095000123
Problems on ages

Relative speed LCM concept

www.kodnest.com 8095000123
Coding decoding

Syllogism

www.kodnest.com 8095000123

You might also like