TO THE NEW
Interview Questions and Answers
Q1. Easy question: Write a program to separate odd and even numbers from an array.
Program to separate odd and even numbers from an array.
Loop through array and check if each number is odd or even
Create two separate arrays for odd and even numbers
Return both arrays
Q2. Design database schema for food delivery app
Design a database schema for a food delivery app
Create tables for users, restaurants, orders, and menu items
Use foreign keys to establish relationships between tables
Include columns for user details, restaurant details, order details, and menu item details
Consider adding tables for reviews, ratings, and payment information
Q3. What is java platform independent
Java platform independence refers to the ability of Java code to run on any device or operating system without modification.
Java code is compiled into bytecode, which can be executed on any device with a Java Virtual Machine (JVM)
JVM acts as an abstraction layer between the Java code and the underlying hardware and operating system
This allows Java programs to be written once and run anywhere, making them platform independent
Q4. SQL query for second max salary
Use SQL query with subquery to find second highest salary
Use subquery to find the max salary first
Then use another subquery to find the max salary excluding the previously found max salary
Q5. difference between java and c++
Java is platform-independent, object-oriented, and has automatic memory management. C++ is faster, closer to hardware, and allows more control over memory management.
Java is platform-independent, while C++ is platform-dependent.
Java is object-oriented, while C++ supports both procedural and object-oriented programming.
Java has automatic memory management (garbage collection), while C++ requires manual memory management.
C++ is faster than Java due to its closer-to-hardware nat...read more
Q6. Access modifiers in depth
Access modifiers control the visibility and accessibility of classes, methods, and variables in object-oriented programming.
Access modifiers include public, private, protected, and default (package-private)
Public: accessible from any other class
Private: only accessible within the same class
Protected: accessible within the same package and subclasses
Default: accessible within the same package
Q7. Inheritance in java
Inheritance in Java allows a class to inherit properties and behaviors from another class.
Inheritance is achieved using the 'extends' keyword in Java.
Subclasses can access the methods and fields of the superclass.
Java does not support multiple inheritance, but a class can implement multiple interfaces.
Q8. Design LRU Cache
LRU Cache is a data structure that stores the most recently used items, discarding the least recently used items when full.
Use a combination of a doubly linked list and a hashmap to efficiently implement LRU Cache.
When an item is accessed, move it to the front of the linked list to mark it as the most recently used.
When the cache is full, remove the least recently used item from the end of the linked list and the hashmap.
Q9. Palindrome sentence
A palindrome sentence is a sentence that reads the same forwards and backwards.
Check if the sentence is the same when read forwards and backwards, ignoring spaces and punctuation.
Examples: 'A man, a plan, a canal, Panama' is a palindrome sentence.
Examples: 'Hello world' is not a palindrome sentence.
Interview Process at null
Top Software Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month