Add office photos
Employer?
Claim Account for FREE

Yodlee

3.8
based on 257 Reviews
Video summary
Filter interviews by

Zocket Technologies Interview Questions and Answers

Updated 5 Feb 2024
Popular Designations

Q1. Prime Numbers Identification

Given a positive integer N, your task is to identify all prime numbers less than or equal to N.

Explanation:

A prime number is a natural number greater than 1 that has no positive d...read more

Ans.

Identify all prime numbers less than or equal to a given positive integer N.

  • Iterate from 2 to N and check if each number is prime

  • Use the Sieve of Eratosthenes algorithm for better efficiency

  • Optimize by only checking up to the square root of N for divisors

Add your answer

Q2. Palindrome String Validation

Determine if a given string 'S' is a palindrome, considering only alphanumeric characters and ignoring spaces and symbols.

Note:
The string 'S' should be evaluated in a case-insensi...read more
Ans.

Check if a given string is a palindrome after removing special characters, spaces, and converting to lowercase.

  • Remove special characters and spaces from the string

  • Convert the string to lowercase

  • Check if the modified string is a palindrome by comparing characters from start and end

Add your answer
Q3. What is the difference between an abstract class and an interface in Java?
Ans.

Abstract class can have both abstract and non-abstract methods, while interface can only have abstract methods.

  • Abstract class can have constructors, member variables, and methods with implementation.

  • Interface can only have abstract methods and constants.

  • A class can implement multiple interfaces but can only extend one abstract class.

  • Example: Abstract class - Animal with abstract method 'eat', Interface - Flyable with method 'fly'.

Add your answer
Q4. What is the difference between an Error and an Exception in Java?
Ans.

Error is a serious issue that cannot be handled at runtime, while Exception is a recoverable issue that can be caught and handled.

  • Error is a subclass of Throwable and is usually caused by the environment or system, such as running out of memory or stack overflow.

  • Exception is also a subclass of Throwable but is caused by the application code, such as invalid input or file not found.

  • Errors are unchecked and are not meant to be caught or handled by the application, while Excepti...read more

Add your answer
Discover Zocket Technologies interview dos and don'ts from real experiences
Q5. What are the requirements for creating an immutable class in Java?
Ans.

Requirements for creating an immutable class in Java

  • Make the class final so it cannot be extended

  • Make all fields private and final

  • Do not provide setter methods, only getter methods

  • Ensure that mutable objects are not returned in getter methods

  • Override equals() and hashCode() methods for proper comparison

  • Consider making defensive copies of mutable fields in constructor or getter methods

Add your answer
Q6. What is the difference between static methods and instance methods in Java?
Ans.

Static methods belong to the class itself, while instance methods belong to individual objects of the class.

  • Static methods are called using the class name, while instance methods are called using object references.

  • Static methods cannot access instance variables directly, while instance methods can access both static and instance variables.

  • Static methods are shared among all instances of the class, while instance methods are unique to each object.

  • Example: Math.max() is a stati...read more

Add your answer
Q7. What is the difference between ClassNotFoundException and NoClassDefFoundError in Java?
Ans.

ClassNotFoundException occurs when a class is not found during runtime, while NoClassDefFoundError occurs when a class was found during compilation but not during runtime.

  • ClassNotFoundException is a checked exception, while NoClassDefFoundError is an Error.

  • ClassNotFoundException occurs when a class is not found at runtime, usually due to a missing classpath or incorrect class name.

  • NoClassDefFoundError occurs when a class was found during compilation but not found during runti...read more

Add your answer
Q8. What is SerialVersionUID in Java?
Ans.

SerialVersionUID is a unique identifier used by Java to ensure the compatibility of serialized objects.

  • SerialVersionUID is a static final long variable in a class that implements Serializable interface.

  • It is used to ensure that the serialized object can be deserialized correctly even if the class definition has changed.

  • If the SerialVersionUID of the serialized object does not match the one in the class, an InvalidClassException is thrown.

  • It is recommended to explicitly declar...read more

Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Software Developer Interview Questions from Similar Companies

4.0
 • 49 Interview Questions
3.7
 • 33 Interview Questions
4.1
 • 25 Interview Questions
3.9
 • 18 Interview Questions
3.4
 • 17 Interview Questions
3.0
 • 14 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
75 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