https://github.com/sainingo/turnkey-assessment
https://github.com/sainingo/turnkey-assessment
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/sainingo/turnkey-assessment
- Owner: sainingo
- Created: 2023-07-27T06:27:07.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-07-27T08:40:40.000Z (almost 3 years ago)
- Last Synced: 2025-03-10T04:48:04.403Z (over 1 year ago)
- Language: Java
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
**TURNKEY ASSESSMENT**
This README file provides a detailed explanation of the task
---
### Question 1: Fibonacci Sequence
The task is to implement a program that allows a user to ask for an input number and then print the Fibonacci sequence up to that number.
The program allows the user to input a positive integer and prints the Fibonacci sequence up to that number. The code is modular, includes error handling, and follows best practices for logging.
### Question 2: Largest Difference
Task is to implement a Java function that takes a list of integers as input and returns the largest difference between any two numbers in the list.
The function uses a straightforward iterative approach to find the largest difference between any two numbers in the input list. It includes error handling and efficiently calculates the largest difference with a time complexity of O(n).
### Question 3: SQL Query for Employee Selection
The task is to write an SQL query to select all employees whose age is above 30 and salary is above $50,000. The requirements include writing the SQL query that satisfies the given conditions, optimizing the query for performance, ensuring clarity and readability, and demonstrating a good understanding of SQL syntax and concepts.
The query uses the `SELECT` statement with a `WHERE` clause to filter employees based on age and salary conditions.
### Question 4: Data Type Conversion
The code is intended to calculate the average of a list of numbers. However, there is an issue related to data type conversion, leading to an unexpected output.
The `total` variable is of type `int`, and the division with `numbers.length` also being an `int` truncates the result. To fix the code, explicitly converting the `total` variable to `double` before performing the division to retain the decimal part of the result.
---