Developer 2

Developer 2 Interview Questions and Answers

Updated 24 Mar 2025

Q1. What is the difference between sealed class and ENUM

Ans.

Sealed classes allow for controlled inheritance, while enums define a fixed set of constants.

  • Sealed classes restrict inheritance to a specific set of subclasses.

  • Enums represent a fixed set of named constants, often used for categorical data.

  • Example of sealed class: 'sealed class Shape { class Circle : Shape; class Square : Shape; }'

  • Example of enum: 'enum Color { Red, Green, Blue }'

  • Sealed classes can have state and behavior, while enums are typically stateless.

Q2. Status codes of GET, POST, PUT, PATCH, DELETE

Ans.

Status codes for HTTP methods

  • GET - 200 OK, 404 Not Found

  • POST - 201 Created, 400 Bad Request

  • PUT - 200 OK, 204 No Content

  • PATCH - 200 OK, 204 No Content

  • DELETE - 200 OK, 204 No Content

Q3. How to implement AIDL in android application

Ans.

AIDL enables communication between different Android components, especially across processes.

  • Define AIDL interface in a .aidl file, e.g., 'IMyAidlInterface.aidl'.

  • Implement the AIDL interface in a Service class, e.g., 'MyAidlService'.

  • Bind the service in the client activity using 'bindService()'.

  • Use the generated binder to call methods defined in the AIDL interface.

  • Ensure proper permission handling for inter-process communication.

Q4. Different Types of HTTP methods

Ans.

HTTP methods are used to indicate the desired action to be performed on a resource.

  • GET: Retrieve data from a server

  • POST: Send data to a server to create a new resource

  • PUT: Update an existing resource on a server

  • DELETE: Remove a resource from a server

  • PATCH: Partially update an existing resource on a server

Are these interview questions helpful?

Q5. What is data class and write code

Ans.

A data class is a special class in programming that holds data and automatically generates methods like equals(), hashCode(), and toString().

  • Data classes are primarily used to store data without much boilerplate code.

  • In Python, a data class can be created using the @dataclass decorator.

  • Example in Python: @dataclass class Point: x: int; y: int.

  • In Kotlin, data classes are defined using the 'data' keyword.

  • Example in Kotlin: data class User(val name: String, val age: Int).

Q6. OOPs concepts and types of polymorphism

Ans.

OOP concepts include encapsulation, inheritance, and polymorphism, with polymorphism allowing methods to do different things based on context.

  • Encapsulation: Bundling data and methods that operate on the data within one unit (class). Example: A class 'Car' with properties like 'color' and methods like 'drive()'.

  • Inheritance: Mechanism where a new class inherits properties and methods from an existing class. Example: 'ElectricCar' inherits from 'Car'.

  • Polymorphism: Ability for di...read more

Share interview questions and help millions of jobseekers 🌟

man-with-laptop

Q7. Write program to sort the list array

Ans.

This program sorts an array of strings in alphabetical order using a simple sorting algorithm.

  • Use built-in sorting functions like `sort()` in Python: `my_list.sort()`.

  • For custom sorting, use a key function: `sorted(my_list, key=len)` sorts by string length.

  • Example: Sorting an array of strings: `['banana', 'apple', 'cherry']` results in `['apple', 'banana', 'cherry']`.

Q8. Write to program to reverse the string

Developer 2 Jobs

Developer II - Embedded Software 2-3 years
UST
3.8
Coimbatore
Developer II (.Net, C#) 4-6 years
United Airlines
4.0
Gurgaon / Gurugram
Developer II - Jr. Developer (.NET gRPC + SQL) 2-3 years
UST
3.8
Thiruvananthapuram
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Interview experiences of popular companies

3.8
 • 517 Interviews
4.0
 • 90 Interviews
View all

Calculate your in-hand salary

Confused about how your in-hand salary is calculated? Enter your annual salary (CTC) and get your in-hand salary

Developer 2 Interview Questions
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
65 L+

Reviews

4 L+

Interviews

4 Cr+

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