Vistaar Technologies
10+ Good Samaritan School Interview Questions and Answers
Q1. Difference between delete, truncate and drop in SQL?
Delete removes specific rows, truncate removes all rows, drop removes entire table structure.
Delete is a DML command used to remove specific rows from a table.
Truncate is a DDL command used to remove all rows from a table.
Drop is a DDL command used to remove the entire table structure.
Delete can be rolled back, truncate cannot be rolled back, drop cannot be rolled back.
Q2. what is hashMap
HashMap is a data structure in Java that stores key-value pairs and allows for fast retrieval of values based on keys.
HashMap is part of the Java Collections framework.
It uses hashing to store and retrieve elements quickly.
Each key in a HashMap must be unique.
Example: HashMap
map = new HashMap<>(); map.put("apple", 5); int value = map.get("apple");
Q3. what is binary search puzzle
Binary search is a search algorithm that finds the position of a target value within a sorted array.
Divide the array in half and compare the target value with the middle element
If the target value is smaller, search the left half of the array. If larger, search the right half
Repeat the process until the target value is found or the subarray is empty
Q4. 3 sheep and 3 wolf problem
3 sheep and 3 wolf problem is a classic puzzle where the objective is to move all the animals to the other side of the river.
Only one or two animals can be transported at a time.
If there are more wolves than sheep on either side of the river, the wolves will eat the sheep.
The puzzle can be solved in 11 moves.
Q5. explain project
Developed a web-based project management tool for tracking tasks and deadlines.
Used HTML, CSS, and JavaScript for the frontend
Implemented RESTful APIs using Node.js and Express.js for the backend
Utilized a PostgreSQL database for storing project data
Implemented user authentication and authorization using JWT
Integrated third-party libraries like Moment.js for date and time manipulation
Q6. Explain Greedy algorithms and Divide and Conquer techniques
Greedy algorithms make the optimal choice at each step, while Divide and Conquer breaks a problem into smaller subproblems.
Greedy algorithms select the best option at each step without considering the overall solution
Divide and Conquer divides a problem into smaller subproblems, solves them recursively, and then combines the solutions
Example of Greedy algorithm: Dijkstra's shortest path algorithm
Example of Divide and Conquer: Merge Sort
Q7. Explain Binary search algorithm
Binary search is a divide and conquer algorithm that searches for a target value within a sorted array.
Divide the array in half and compare the target value with the middle element
If the target value is less than the middle element, search the left half of the array
If the target value is greater than the middle element, search the right half of the array
Repeat the process until the target value is found or the subarray is empty
Q8. Explain Joins, types of joins
Joins are used to combine rows from two or more tables based on a related column between them.
Types of joins include INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL JOIN.
INNER JOIN returns rows when there is at least one match in both tables.
LEFT JOIN returns all rows from the left table and the matched rows from the right table.
RIGHT JOIN returns all rows from the right table and the matched rows from the left table.
FULL JOIN returns rows when there is a match in one of the tabl...read more
Q9. Explain Multithreading
Multithreading is the ability of a CPU to execute multiple threads concurrently, allowing for improved performance and responsiveness in software applications.
Multithreading allows multiple threads to run concurrently within a single process.
Each thread has its own stack and program counter, but shares the same memory space.
Multithreading can improve performance by utilizing multiple CPU cores efficiently.
Examples of multithreading include web servers handling multiple client...read more
Q10. Explain deadlocks
Deadlocks occur when two or more processes are unable to proceed because each is waiting for the other to release a resource.
Deadlocks happen when processes compete for resources and each holds a resource needed by the other.
Four conditions must hold for a deadlock to occur: mutual exclusion, hold and wait, no preemption, and circular wait.
Examples of resources that can lead to deadlocks include locks, semaphores, and memory.
Deadlocks can be prevented or resolved using techni...read more
Interview Process at Good Samaritan School
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month