Developer

20+ Developer Interview Questions and Answers for Freshers

Updated 12 Jul 2025
search-icon
1d ago

Q. You have a 3-gallon jug and a 5-gallon jug. How would you measure out exactly 4 gallons of water?

Ans.

Fill the 3 gallon jug, pour it into the 5 gallon jug, fill the 3 gallon jug again, pour it into the 5 gallon jug until it is full, leaving 1 gallon in the 3 gallon jug.

  • Fill the 3 gallon jug

  • Pour the 3 gallon jug into the 5 gallon jug

  • Fill the 3 gallon jug again

  • Pour the 3 gallon jug into the 5 gallon jug until it is full

  • The 4 gallon jug will have 1 gallon of water

Asked in Amdocs

1d ago

Q. Write a query to find the second highest salary in a table.

Ans.

Query to find the second highest salary in a table.

  • Use the MAX() function to find the highest salary.

  • Use the WHERE clause to exclude the highest salary from the result.

  • Use the MAX() function again to find the second highest salary.

2d ago

Q. Write a program to find the reverse of a string

Ans.

A program to reverse a string

  • Iterate through the characters of the string from the last to the first

  • Append each character to a new string

  • Return the reversed string

4d ago

Q. What are APIs and how are they used in software development?

Ans.

APIs (Application Programming Interfaces) enable software applications to communicate and interact with each other seamlessly.

  • APIs define a set of rules and protocols for building and interacting with software applications.

  • They allow different software systems to exchange data and functionality, enhancing interoperability.

  • For example, a weather API can provide real-time weather data to a mobile app.

  • APIs can be RESTful, using HTTP requests to access and manipulate data, or SOA...read more

Are these interview questions helpful?

Asked in Cognizant

3d ago

Q. Write code to print the matching characters of two strings.

Ans.

This code identifies and prints characters that are common between two given strings.

  • Use a set to store characters of the first string for efficient lookup.

  • Iterate through the second string and check if each character is in the set.

  • Collect matching characters and print them as a string.

  • Example: For strings 'apple' and 'grape', the output should be 'ap'.

3d ago

Q. What are the benefits of using PHP frameworks like Laravel?

Ans.

PHP frameworks like Laravel enhance development speed, maintainability, and security, making web applications more robust and scalable.

  • Rapid Development: Laravel's built-in tools like Eloquent ORM and Artisan CLI streamline common tasks, reducing development time.

  • MVC Architecture: Laravel follows the Model-View-Controller pattern, promoting a clean separation of concerns and better organization of code.

  • Security Features: Laravel provides protection against common vulnerabilit...read more

Developer Jobs

SAP India Pvt.Ltd logo
Developer- ABAP, CDS, Odata, BOPF 4-8 years
SAP India Pvt.Ltd
4.2
₹ 9 L/yr - ₹ 28 L/yr
(AmbitionBox estimate)
Bangalore / Bengaluru
SAP India Pvt.Ltd logo
Developer 4-7 years
SAP India Pvt.Ltd
4.2
₹ 9 L/yr - ₹ 30 L/yr
(AmbitionBox estimate)
Bangalore / Bengaluru
Red Hat India Pvt Ltd logo
App Dev Developer 4-9 years
Red Hat India Pvt Ltd
4.3
Mumbai

Asked in Coda Global

4d ago

Q. Write code for a two-way switch.

Ans.

A two-way switch is a device that can be used to control a single electrical circuit from two different locations.

  • A two-way switch typically has three terminals: a common terminal and two traveler terminals.

  • The common terminal is connected to the power source, while the traveler terminals are connected to the load.

  • The switch can be toggled between the two traveler terminals to control the circuit from different locations.

Asked in ION Group

5d ago

Q. Describe your approach to solving the two-egg problem.

Ans.

The 2 egg problem is a classic puzzle about minimizing egg drops to find the highest safe floor in a building.

  • Use two eggs to minimize the number of drops needed.

  • Start dropping from a certain floor and increase the drop floor incrementally.

  • If the first egg breaks, use the second egg to check each floor below the last drop.

Share interview questions and help millions of jobseekers 🌟

man-with-laptop

Q. What programming languages have you learned?

Ans.

I have learned multiple programming languages including Java, Python, and C++.

  • Java

  • Python

  • C++

Q. Tell me about the Python language.

Ans.

Python is a high-level programming language known for its simplicity and readability.

  • Python is an interpreted language, which means it does not need to be compiled before running.

  • It has a large standard library that provides many useful modules and functions.

  • Python supports multiple programming paradigms, including procedural, object-oriented, and functional programming.

  • It is widely used in web development, data analysis, artificial intelligence, and scientific computing.

  • Pyth...read more

Asked in Infosys

3d ago

Q. What is SDLC?

Ans.

SDLC stands for Software Development Life Cycle. It is a process used to design, develop, and test software applications.

  • SDLC is a systematic approach to software development.

  • It consists of several phases including requirements gathering, design, coding, testing, and maintenance.

  • Each phase has specific activities and deliverables.

  • SDLC models include Waterfall, Agile, and DevOps.

  • It ensures the quality and reliability of software applications.

Asked in UST

5d ago

Q. Which OOP concepts have you used?

Ans.

Encapsulation, Inheritance, Polymorphism, Abstraction

  • Encapsulation: bundling of data and methods that act on that data within a single unit

  • Inheritance: ability of a class to inherit properties and methods from a parent class

  • Polymorphism: ability of objects to take on many forms

  • Abstraction: hiding of complex implementation details and showing only the necessary information

Asked in Nium

4d ago

Q. Design a system.

Ans.

Design a scalable online food delivery system with user-friendly features and efficient logistics.

  • User Registration: Allow users to create accounts and manage profiles.

  • Restaurant Listings: Provide a searchable database of restaurants with menus.

  • Order Management: Implement a system for users to place, track, and manage orders.

  • Payment Integration: Support multiple payment methods like credit cards and digital wallets.

  • Delivery Logistics: Optimize routes for delivery drivers to e...read more

Asked in Coda Global

3d ago

Q. Write the code for Merge Sort.

Ans.

Merge sort is a divide-and-conquer algorithm that sorts an array by recursively splitting and merging sorted subarrays.

  • 1. Divide the array into two halves until each subarray contains a single element.

  • 2. Merge the subarrays back together in sorted order.

  • 3. The merging process involves comparing the smallest elements of each subarray.

  • 4. Example: Sorting [38, 27, 43, 3, 9, 82, 10] results in [3, 9, 10, 27, 38, 43, 82].

Q. How would you describe your ideal work environment?

Ans.

The work environment is collaborative and supportive.

  • The team is friendly and helpful

  • Open communication is encouraged

  • Flexible work hours and remote work options are available

6d ago

Q. Why did you choose this company?

Ans.

I chose this company for its innovative projects, strong values, and commitment to employee growth and development.

  • The company's focus on cutting-edge technology aligns with my passion for innovation, as seen in their recent AI project.

  • I admire the company's commitment to sustainability, demonstrated by their initiatives to reduce carbon footprint.

  • The collaborative culture here fosters teamwork, which I experienced during my internship where cross-functional teams worked toge...read more

5d ago

Q. Tell me about your skills.

Ans.

I possess strong programming skills, expertise in software development, and a passion for problem-solving and innovation.

  • Proficient in languages like Java, Python, and JavaScript, with experience in building web applications.

  • Experienced in using frameworks such as React and Angular for front-end development.

  • Skilled in database management with SQL and NoSQL databases like MySQL and MongoDB.

  • Familiar with version control systems like Git, enabling efficient collaboration in team...read more

Asked in Cognizant

3d ago

Q. Oops concept from java

Ans.

Oops concept is a programming paradigm that focuses on objects and their interactions to solve problems.

  • Encapsulation - hiding implementation details

  • Inheritance - creating new classes from existing ones

  • Polymorphism - using a single interface to represent multiple types

  • Abstraction - simplifying complex systems by breaking them down into smaller, more manageable parts

Asked in ITC

2d ago

Q. What is Heap Sort?

Ans.

Heap sort is a comparison-based sorting algorithm that uses a binary heap data structure.

  • Heap sort works by first building a max heap from the input array.

  • It then repeatedly extracts the maximum element from the heap and rebuilds the heap.

  • The time complexity of heap sort is O(n log n) and it is an in-place sorting algorithm.

  • Example: [4, 10, 3, 5, 1] -> [1, 3, 4, 5, 10]

Asked in UST

6d ago

Q. Spring-Boot Use

Ans.

Spring Boot is a framework that simplifies the development of Java applications by providing pre-configured settings and dependencies.

  • Spring Boot is built on top of the Spring framework and follows the convention over configuration principle.

  • It provides a standalone executable JAR file that includes an embedded server, making it easy to deploy and run applications.

  • Spring Boot offers auto-configuration, which automatically configures the application based on the dependencies p...read more

Asked in V2Solutions

3d ago

Q. Can you provide real-life examples of OOPS concepts?

Ans.

OOP principles can be illustrated through real-life scenarios, enhancing understanding of encapsulation, inheritance, and polymorphism.

  • Encapsulation: A car's engine is hidden from the driver; they interact with the car through the steering wheel and pedals.

  • Inheritance: A 'Dog' class can inherit properties from an 'Animal' class, sharing traits like 'bark' and 'eat'.

  • Polymorphism: A 'Shape' class can have methods like 'draw', which behaves differently for 'Circle' and 'Square' ...read more

Asked in Cybage

4d ago

Q. Design a database for a college.

Ans.

Design a database for a college

  • Identify entities such as students, faculty, courses, departments, etc.

  • Create tables for each entity with appropriate attributes

  • Establish relationships between tables using foreign keys

  • Consider normalization to avoid data redundancy

  • Implement security measures to protect sensitive data

6d ago

Q. What is the best sorting algorithm and why?

Ans.

The best sorting algorithm is dependent on the specific use case and data size.

  • Quick Sort is efficient for large datasets due to its average time complexity of O(n log n)

  • Merge Sort is stable and has a time complexity of O(n log n) but requires extra space

  • Insertion Sort is simple and efficient for small datasets with time complexity of O(n^2)

  • Heap Sort is efficient and has a time complexity of O(n log n) but is not stable

Asked in SDL SOFTTECH

5d ago

Q. Design form and display

Ans.

Designing a form and its display involves considering user experience and functionality.

  • Identify the purpose and goals of the form

  • Choose appropriate form elements and layout

  • Ensure clear and concise labeling and instructions

  • Consider accessibility and responsive design

  • Test and iterate for optimal user experience

2d ago

Q. Truncate vs Delete

Ans.

Truncate is faster but cannot be rolled back, while Delete is slower but can be rolled back.

  • Truncate removes all rows from a table quickly, but cannot be rolled back.

  • Delete removes rows one by one, slower than Truncate, but can be rolled back using a transaction.

  • Truncate resets the identity seed of the table, while Delete does not.

Q. middle ware in .net

Ans.

Middle ware in .NET refers to software that acts as a bridge between an operating system or database and applications, providing services such as communication, security, and data management.

  • Middleware in .NET can be used to handle communication between different components of an application.

  • It can provide services like authentication, authorization, and logging.

  • Examples of middleware in .NET include ASP.NET Core middleware for handling HTTP requests and responses.

Interview Experiences of Popular Companies

TCS Logo
3.6
 • 11.1k Interviews
Accenture Logo
3.7
 • 8.7k Interviews
Infosys Logo
3.6
 • 7.9k Interviews
Wipro Logo
3.7
 • 6.1k Interviews
Cognizant Logo
3.7
 • 5.9k Interviews
View all
interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories
Developer Interview Questions
Share an Interview
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

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

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits