Zypp Electric

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

Zypp Electric

Software Engineer Test 1 - Time:- 45 Mins

Follow any specific instructions provided with each question.

1. Which of the following is a superclass of every class in Java?


a) ArrayList
b) Abstract class
c) Object class
d) String

2. Which one of the following is not an access modifier?


a) Protected
b) Void
c) Public
d) Private

3. Which of these is the correct way of inheriting class A by class B?


a) class B + class A {}
b) class B inherits class A {}
c) class B extends A {}
d) class B extends class A {}

4. Which of these keywords are used for generating an exception manually?


a) try
b) catch
c) throw
d) check

5. What happens if we put a key object in a HashMap which exists?


a) The new object replaces the older object
b) The new object is discarded
c) The old object is removed from the map
d) It throws an exception as the key already exists in the map

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
d) None of the mentioned
7. What is the use of final keyword in Java?
a) When a class is made final, a subclass of it can not be created
b) When a method is final, it can not be overridden.
c) When a variable is final, it can be assigned value only once.
d) All of the above

8. What is true about a break?


a) Break stops the execution of entire program
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]
import java.util.ArrayList;
import java.util.Arrays;

public class RemoveDuplicatesFromArraylist {


public static void main(String[] args) {
ArrayList<Integer> num = new ArrayList<>(Arrays.asList(1, 2, 4, 2, 4,
5));
for (int i = 0; i < num.size(); i++) {
for (int j = i + 1; j < num.size(); j++) {
if (num.get(i).equals(num.get(j))) {
num.remove(j);
j--;
}
}
}
System.out.println(num);
}
}
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

public class FindElement {

public static int find(int[] nums, int target) {


int left = 0;
int right = nums.length - 1;

while (left <= right) {


int mid = left + (right - left) / 2;

if (nums[mid] == target)
return mid;
else if (nums[mid] < target)
left = mid + 1;
else
right = mid - 1;
}

return left;
}

public static void main(String[] args) {


int[] nums = new int[] { 1, 3, 5, 6 };
int target = 5;
System.out.println(find(nums, target));
}
}
SQL Questions
Estimated Time 45 Minutes

1. Which MySQL function would you use to concatenate strings from multiple
rows into a single string?

CONCAT_WS

GROUP_CONCAT

CONCAT

STRING_CONCAT

2. Which SQL keyword is used to define a window function?

WINDOW

OVER

PARTITION

WITH

3. In a SQL query containing multiple clauses (e.g., SELECT, FROM, WHERE,


JOIN, GROUP BY, ORDER BY , what is the typical execution order?

FROM/JOIN, WHERE, GROUP BY, HAVING, SELECT , ORDER BY,


LIMIT/OFFSET

SELECT, FROM/JOIN, WHERE, GROUP BY, HAVING ORDER BY,


LIMIT/OFFSET

SELECT, FROM/JOIN, WHERE, ORDER BY, GROUP BY, HAVING,


LIMIT/OFFSET

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?

DROP INDEX

DELETE INDEX

SQL Questions 1
REMOVE INDEX

ERASE INDEX

5. What is the primary purpose of the CASE WHEN statement in SQL?

To define conditions for filtering rows in a WHERE clause.

To specify the order in which columns should be sorted in a result set.

To perform conditional logic and return different values based on


specified conditions.

To join multiple tables based on common columns.

6. In MySQL, which statement is used to add an index to an existing table?

ALTER INDEX

MODIFY INDEX

ADD INDEX

CREATE INDEX

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?

INNER JOIN

LEFT JOIN

RIGHT JOIN

FULL OUTER JOIN

8. In SQL, what is the typical syntax for using the LAG function?

LAG(column_name)

LAG(column_name, n)

LAG(n, column_name)

LAG

9. Question 1:
Consider the following scenario where you have a table named
"employees" in a MySQL database. The table has the following structure:

SQL Questions 2
CREATE TABLE employees (
emp_id INT PRIMARY KEY,
emp_name VARCHAR(50),
department_id INT,
salary DECIMAL(10, 2),
hire_date DATE
);

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.

Answer: -

CREATE INDEX idx_department_salary ON employees (department_id, salary);

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

Create Table Query

CREATE TABLE orders (


customer_placed_order_datetime DATETIME,
SQL Questions placed_order_with_restaurant_datetime DATETIME, 3

driver_at_restaurant_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
);

Answer: -

SELECT
driver_id,
AVG(order_total) AS average_order_value
FROM
orders
WHERE
delivered_to_consumer_datetime IS NOT NULL
AND TIMESTAMPDIFF(MINUTE, placed_order_with_restaurant_datetime,
delivered_to_consumer_datetime) <= 45
GROUP BY
driver_id;

SQL Questions 4
NAME:- RAJA SAHA Reg.No:- 12209471 Date:- 15/02/2024

Instructions: Time:- 30 Min

Part A - MCQs:

A. Read each question carefully and select the correct option (A, B, C, or D).
B. Mark your answer on the provided answer sheet or select the corresponding option electronically.
C. Review your answers before submission.

Part B - Open-ended:

A. Provide detailed responses to each question.


B. Use examples or personal experiences where applicable.
C. Follow any specific instructions provided with each question.

Part - A
MCQ

● Which communication protocol is commonly used for lightweight messaging in IoT?


A) TCP
B) HTTP
C) MQTT
D) FTP

● What is a telematics device primarily used for?


a) Remote vehicle diagnostics
b) GPS navigation
c) In-car entertainment
d) Tire pressure monitoring

● What technology is commonly used for wireless communication in telematics


devices?
a) Bluetooth
b) Zigbee
c) Wi-Fi
d) Cellular

● What is the main purpose of the GPS receiver in a telematics device?


a) Monitor engine performance
b) Control vehicle temperature
c) Track vehicle location
d) Adjust tire pressure

1
● What does CAN stand for in the context of telematics devices?
a) Controlled Area Network
b) Cellular Access Network
c) Controller Area Network
d) Centralized Area Network

● What is the purpose of the accelerometer in a telematics device?


a) Measure vehicle speed
b) Detect harsh driving events
c) Monitor fuel consumption
d) Control vehicle lighting

● How do telematics devices contribute to fleet management?


a) Increased fuel consumption
b) Reduced vehicle downtime
c) Higher maintenance costs
d) Decreased driver safety

● What security feature is commonly offered by advanced telematics devices?


a) Real-time vehicle tracking
b) Driver behavior monitoring
c) Remote engine immobilization
d) In-car entertainment

● What regulatory compliance standards are telematics devices typically required to


meet?
a) ISO 9001
b) OBD-II
c) FCC
d) None of the above

● How do telematics devices facilitate remote vehicle diagnostics?


a) By providing real-time alerts for maintenance issues
b) By controlling vehicle temperature settings
c) By monitoring tire pressure
d) By adjusting engine performance

2
Part-B
Answer the following Questions

1. How do Telematic IoT devices facilitate remote diagnostics and predictive


maintenance?
Answer:-
• Advanced Analytics and Machine Learning: Predicting
maintenance needs based on historical data allows for proactive
planning, minimizing downtime and optimizing resource allocation.

• Predictive Maintenance Alerts: Timely alerts enable proactive


addressing of potential failures, preventing costly breakdowns and
optimizing asset performance.

• Remote Diagnostics Tools: The ability to troubleshoot issues


remotely enhances operational efficiency, reducing the need for on-
site inspections and minimizing downtime.

• Condition-Based Maintenance: Shifting from traditional scheduled


maintenance to condition-based approaches optimizes resources by
addressing maintenance needs based on actual asset conditions.

• Real-Time Monitoring: Constantly collecting real-time data on asset


performance provides immediate insights, allowing for quick response
to changing conditions and effective decision-making.

2. What are the key factors to consider when selecting Telematic IoT devices for fleet
management and logistics operations?
Answer:-
• Connectivity: Ensure compatibility with reliable and scalable communication
networks to maintain constant communication with fleet assets.
• Accuracy: Prioritize devices with accurate GPS tracking and sensor readings
to make informed decisions based on reliable data.
• Real-Time Monitoring: Choose devices providing real-time insights for
effective monitoring and quick response to changes or issues in the fleet.
• Integration: Select devices that seamlessly integrate with existing fleet
management systems to streamline operations and avoid data silos.
• Data Security: Prioritize devices with robust security features to protect
sensitive fleet data and comply with privacy regulations.

3
3. How does IoT contribute to the concept of smart cities?
OR
Can you describe a project or experience where you successfully implemented an IoT
solution?
Answer:-
The “AirWatch” project, an IoT-based Air Quality Tracker Solution, addresses global
air pollution concerns by developing an affordable gadget to monitor pollutants like
CO, CO2, noise, temperature, and humidity. Utilizing ESP32 for energy-efficient
operation and incorporating sensors such as PM2.5, MQ-7, and MQ135, the system
provides real-time data displayed on an LCD. The project employs machine learning to
enhance sensor accuracy and offers audible alerts through a Piezo Buzzer. Results are
visualized on the Blynk Platform, providing clear insights into air quality levels. Future
plans include advanced data analytics, integration with smart city initiatives, and
continuous sensor improvements to contribute effectively to climate change initiatives
and public health outcomes. The project stands as an impactful solution, striving for a
healthier, sustainable world.

4. What are some challenges or limitations faced in the deployment and implementation
of IoT solutions?
Answer:-

• Security Concerns: Ensuring the security of IoT devices and data from cyber
threats remains a top challenge, requiring continuous efforts to prevent
unauthorized access and data breaches.
• Interoperability: Lack of standardized protocols hinders seamless integration
between different IoT devices and platforms, limiting the scalability and
efficiency of IoT solutions.
• Scalability: As IoT networks grow, managing the scalability of infrastructure
and handling a large number of connected devices become significant challenges.
• Data Privacy: The extensive data collected by IoT devices raises concerns about
user privacy, necessitating clear policies and compliance with data protection
regulations.
• Power Consumption: Optimizing power consumption is crucial, especially for
devices with limited battery life, to ensure prolonged device lifespan and
operational efficiency.

You might also like