Qburst
10+ Interview Questions and Answers
Q1. Is it possible to work with multiple threads in core data? If so, how?
Yes, it is possible to work with multiple threads in core data.
Use NSManagedObjectContextConcurrencyType to specify concurrency type
Create a separate managed object context for each thread
Use performBlock or performBlockAndWait to execute tasks on the correct context
Merge changes from other contexts using NSManagedObjectContextDidSaveNotification
Q2. Optimal algorithm for finding common elements in two arrays.
The optimal algorithm for finding common elements in two arrays is using a hash table.
Create a hash table for one of the arrays.
Iterate through the other array and check if each element exists in the hash table.
If it does, add it to the result array.
Time complexity is O(n) and space complexity is O(n).
Q3. How memory leaks happen?
Memory leaks occur when a program fails to release memory that is no longer needed.
Memory leaks can happen due to programming errors such as not freeing allocated memory
Leaked memory can accumulate over time and cause the program to crash or slow down
Memory leaks can be detected using tools such as valgrind or by analyzing the program's behavior
Examples of memory leaks include forgetting to free memory allocated for a variable or not closing a file after reading from it
Q4. java code to filter even numbers from a list and store the square of those in another list
Java code to filter even numbers from a list and store the square of those in another list
Create two ArrayLists to store the original list and the squared even numbers list
Iterate through the original list and check if each number is even
If the number is even, square it and add it to the squared even numbers list
Q5. How threads can be created in java
Threads in Java can be created by extending the Thread class or implementing the Runnable interface.
Extend the Thread class and override the run() method
Implement the Runnable interface and implement the run() method
Use the Executor framework for managing threads
Q6. Difference between microcontroller and microprocessor
Microcontrollers are integrated circuits designed for specific tasks with built-in memory and peripherals, while microprocessors are general-purpose CPUs without built-in memory or peripherals.
Microcontrollers are typically used in embedded systems for specific tasks like controlling a microwave oven or a washing machine.
Microprocessors are used in general-purpose computing devices like laptops, desktops, and servers.
Microcontrollers have built-in memory and peripherals like ...read more
Q7. java code to check two strings are anagram
Java code to check if two strings are anagrams
Create a function that takes in two strings as parameters
Convert both strings to char arrays and sort them
Compare the sorted char arrays to check if they are equal
Q8. Why stream api in Java?
Stream API in Java provides a functional approach to processing collections of objects.
Allows for concise and readable code by using functional programming concepts like map, filter, and reduce.
Enables parallel processing of data, improving performance for large datasets.
Supports lazy evaluation, allowing for efficient use of resources.
Example: List
names = Arrays.asList("Alice", "Bob", "Charlie"); names.stream().filter(name -> name.startsWith("A")).forEach(System.out::printl...read more
Q9. Need of functional interfaces in java
Functional interfaces in Java are needed to enable the use of lambda expressions, which provide a concise way to implement single abstract method interfaces.
Functional interfaces have exactly one abstract method and can have multiple default or static methods.
They are used to enable the use of lambda expressions, which provide a concise way to implement the single abstract method.
Examples of functional interfaces in Java include Runnable, Callable, and ActionListener.
Q10. Difference between hardware and RAM
Hardware refers to physical components of a computer, while RAM is a type of hardware that stores data temporarily.
Hardware includes components such as the CPU, motherboard, and hard drive.
RAM stands for Random Access Memory and is used to temporarily store data that the computer is currently using.
Hardware is permanent and cannot be changed without physically replacing the component, while RAM can be upgraded or added to.
Examples of hardware include a keyboard, mouse, and mo...read more
Q11. Promises example
Promises are used in JavaScript to handle asynchronous operations.
Promises are objects that represent the eventual completion or failure of an asynchronous operation.
They are used to handle asynchronous operations in a more readable and manageable way.
Promises have three states: pending, fulfilled, or rejected.
They can be chained using .then() and .catch() methods.
Promises can be created using the Promise constructor or by using the shorthand syntax with async/await.
Example: ...read more
Q12. Array methods in js
Array methods in JavaScript are built-in functions that allow manipulation and traversal of arrays.
Some common array methods include: map(), filter(), reduce(), forEach(), and find().
map() - creates a new array by applying a function to each element in the original array.
filter() - creates a new array with elements that pass a certain condition.
reduce() - applies a function against an accumulator and each element in the array to reduce it to a single value.
forEach() - execute...read more
Q13. Different scenario mitigation
Scenario mitigation involves identifying potential risks and developing strategies to minimize their impact.
Identify potential risks and their likelihood
Develop strategies to minimize impact of risks
Create contingency plans for worst-case scenarios
Regularly review and update mitigation plans
Communicate mitigation plans to stakeholders
Interview Process at null
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month