ZYPP
ZYPP
ZYPP
Reg.No:-12014212
Date:- 15 FEB
a) Array List
b) Abstract class
c) Object class
d) String
a) Protected
b) Void
c) Public
d) Private
a) class B + class A {}
c) class B extends A {}
b) catch
c) throw
d) check
6. What is the process of defining a method in a subclass having same name & type
signature as a method in its superclass?
a) Method overloading
b) Method overriding
c) Method hiding
b) Break halts the execution and forces the control out of the loop
c) Break forces the control out of the loop and starts the execution of next iteration
d) Break halts the execution of the loop for certain time frame
9. How To Remove Duplicate Elements From ArrayList In Java? Input : [1,2,4,2,4,5] Output :
[1,2,4,5]
Sol:
import java.util.ArrayList;
input.add(1);
input.add(2);
input.add(4);
input.add(2);
input.add(4);
input.add(5);
if (!output.contains(element)) {
output.add(element);
return output;
}
}
10. Given a sorted array of distinct integers and a target value, return the index if the target is found.
If not, return the index where it would be if it were inserted in order. You must write an algorithm
with O(log n) runtime complexity. Input: nums = [1,3,5,6], target = 5 Output: 2
#include <iostream>
int left = 0;
left = mid + 1;
} else {
right = mid;
return left;
int main() {
int length = 4;
int key = 5;
return 0;
Software Engineer Test2
SQL Questions
1.Which MySQL function would you use to concatenate strings from multiple rows into a
single string?
1. CONCAT_WS
2. GROUP_CONCAT
3. CONCAT
4. STRING_CONCAT
3. In a SQL query containing multiple clauses (e.g., SELECT, FROM, WHERE, JOIN,
GROUP BY, ORDER BY), what is the typical execution order?
1. FROM/JOIN, WHERE, GROUP BY, HAVING, SELECT, ORDER BY,
LIMIT/OFFSET
2. SELECT, FROM/JOIN, WHERE, GROUP BY, HAVING ORDER BY,
LIMIT/OFFSET
3. SELECT, FROM/JOIN, WHERE, ORDER BY, GROUP BY, HAVING,
LIMIT/OFFSET
4. WHERE, FROM, GROUP BY, HAVING, ORDER BY, SELECT,
LIMIT/OFFSET
4.In MySQL, which of the following commands can be used to remove an index from a
table?
1. DROP INDEX
2. DELETE INDEX
3. REMOVE INDEX
4. ERASE INDEX
5. What is the primary purpose of the CASE WHEN statement in SQL?
1. To define conditions for filtering rows in a WHERE clause.
2. To specify the order in which columns should be sorted in a result set.
3. To perform conditional logic and return different values based on specified
conditions.
4. To join multiple tables based on common columns.
7. Which JOIN type in MySQL is suitable for combining rows from two tables even if there
is no match found in the other table?
1. INNER JOIN
2. LEFT JOIN
3. RIGHT JOIN
4. FULL OUTER JOIN
8. In SQL, what is the typical syntax for using the LAG function?
1. LAG(column_name)
2. LAG(column_name, n)
3. LAG(n, column_name)
4. LAG()
9. Question 1
Now, imagine you frequently execute the following query to retrieve employees earning a
salary greater than a specified amount within a particular department:
SELECT emp_name,
salary FROM employees WHERE department_id = ? AND salary > ?
ORDER BY hire_date DESC;
Based on the provided query, which column or columns would you recommend indexing on
the "employees" table to optimize the query's performance? Write the index structure and
explain your reasoning.
Sol:
As we know the query CREATE INDEX is used to create indexes in tables and those indices are used to
retrieve data very quickly and we are asked to optimize the query’s performance we will make use of
it to speed up searches/queries. Hence, the structure would be:
10. Question 2
The ideal time between when a customer places an order and when the order is delivered is
below or equal to 45 minutes. You have been tasked with evaluating delivery driver
performance by calculating the average order value for each delivery driver who has
delivered at least once within this 45-minute period. Your output should contain the driver ID
along with their corresponding average order value.
Table: Delivery_details
customer_placed_order_datetime DATETIME,
placed_order_with_restaurant_datetime DATETIME,
driver_at_restaurant_datetime DATETIME,
delivered_to_consumer_datetime DATETIME,
driver_id INT,
restaurant_id INT,
consumer_id INT,
is_new BOOLEAN,
delivery_region VARCHAR(255),
is_asap BOOLEAN,
order_total FLOAT,
discount_amount FLOAT,
tip_amount FLOAT,
refunded_amount FLOAT
);
Sol:
SELECT driver_id,
FROM orders
delivered_to_consumer_datetime) <= 45
GROUP BY driver_id;
We will select Driver_id then calculate average order value to calculate the order which was
within the given timeframe. We will then group them for results.
IoT Questions
● Which communication protocol is commonly used for lightweight messaging in IoT?
A) TCP
B) HTTP
C) MQTT
D) FTP
b) GPS navigation
c) In-car entertainment
a) Bluetooth
b) Zigbee
c) Wi-Fi
d) Cellular
d) In-car entertainment
● What regulatory compliance standards are telematics devices typically required to meet?
a) ISO 9001
b) OBD-II
c) FCC