Premium Employer

Rakuten

3.6
based on 420 Reviews
Filter interviews by

Lab & Allied Interview Questions and Answers

Updated 5 Feb 2024

Q1. Merge Two Sorted Arrays Problem Statement

Given two sorted integer arrays ARR1 and ARR2 of size M and N, respectively, merge them into ARR1 as one sorted array. Assume that ARR1 has a size of M + N to hold all ...read more

Ans.

Merge two sorted arrays into one sorted array in place.

  • Iterate from the end of both arrays and compare elements to merge in place

  • Use two pointers to keep track of the current position in each array

  • Handle cases where one array is fully merged before the other

View 3 more answers

Q2. Reverse a Stack Using Recursion

You are given a stack of integers. Your task is to reverse the stack using recursion without using any extra space other than the internal stack space used due to recursion. You ...read more

Ans.

Reverse a stack using recursion without using any extra space other than the internal stack space.

  • Use recursion to pop all elements from the original stack and store them in function call stack

  • Once the stack is empty, push the elements back in reverse order using recursion

  • Make use of auxiliary functions to handle the recursion process

Add your answer
Q3. How are objects created and managed in JVM memory?
Ans.

Objects in JVM memory are created on the heap and managed by the garbage collector.

  • Objects are created on the heap memory in JVM.

  • Memory for objects is allocated using the 'new' keyword.

  • Objects are managed by the garbage collector to reclaim unused memory.

  • Garbage collector uses different algorithms like Mark-Sweep, G1, etc.

  • Example: 'String str = new String("Hello World");'

Add your answer
Q4. Can you explain method overriding in Java?
Ans.

Method overriding in Java allows a subclass to provide a specific implementation of a method that is already provided by its superclass.

  • In method overriding, a subclass provides a specific implementation of a method that is already provided by its superclass.

  • The method in the subclass must have the same name, return type, and parameters as the method in the superclass.

  • Method overriding is used to achieve runtime polymorphism in Java.

  • Example: class Animal { void sound() { Syst...read more

Add your answer
Discover Lab & Allied interview dos and don'ts from real experiences
Q5. What is the JVM?
Ans.

JVM stands for Java Virtual Machine, which is a virtual machine that enables a computer to run Java programs.

  • JVM is an abstract computing machine that enables a computer to run Java programs.

  • It provides a runtime environment in which Java bytecode can be executed.

  • JVM is platform-independent, meaning Java code can run on any device that has a JVM installed.

  • It manages memory, provides security, and facilitates garbage collection.

  • Examples of JVM implementations include Oracle Ho...read more

View 3 more answers
Q6. What is polymorphism in Java?
Ans.

Polymorphism in Java allows objects of different classes to be treated as objects of a common superclass.

  • Polymorphism is achieved through method overriding and method overloading.

  • Method overriding allows a subclass to provide a specific implementation of a method that is already provided by its superclass.

  • Method overloading allows multiple methods with the same name but different parameters in the same class.

  • Polymorphism helps in achieving flexibility and reusability in code....read more

Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at Lab & Allied

based on 2 interviews
Interview experience
5.0
Excellent
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Software Developer Interview Questions from Similar Companies

4.2
 • 122 Interview Questions
3.8
 • 107 Interview Questions
3.2
 • 35 Interview Questions
3.9
 • 35 Interview Questions
3.5
 • 14 Interview Questions
4.0
 • 13 Interview Questions
View all
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
70 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter