Trainee Programmer

40+ Trainee Programmer Interview Questions and Answers

Updated 16 Jan 2025
search-icon

Q1. Networking Questions like What is IP ADDRESS WHAT IS MAC ADDRESS WHAT IS BSOD WHAT IS ACTIVE DIRECTORY WHAT IS NODE WHAT IS LAN WAN MAN WHAT IS SQL WHAT ARE SUBGROUPS OF SQL WHAT IS DML ,DDL TCL DCL? WHAT IS DB...

read more
Ans.

Answers to common networking and database related questions for a Trainee Programmer interview.

  • IP ADDRESS - unique identifier for devices on a network

  • MAC ADDRESS - unique identifier for network interface controllers

  • BSOD - Blue Screen of Death, an error screen displayed on Windows systems

  • ACTIVE DIRECTORY - centralized database for managing network resources

  • NODE - a device or computer on a network

  • LAN WAN MAN - types of networks (Local Area Network, Wide Area Network, Metropolit...read more

Q2. what is polymorphism in Object-Oriented Programming?

Ans.

Polymorphism is the ability of an object to take on many forms.

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

  • It enables methods to be defined in the superclass and overridden in the subclasses.

  • Polymorphism helps in achieving code reusability and flexibility in object-oriented programming.

  • Example: A superclass 'Animal' with subclasses 'Dog' and 'Cat'. Both 'Dog' and 'Cat' can be treated as 'Animal'.

Trainee Programmer Interview Questions and Answers for Freshers

illustration image

Q3. What rating will you give about your programming knowledge out of 10 ?

Ans.

I would rate my programming knowledge as 7 out of 10.

  • I have a strong understanding of programming concepts and syntax.

  • I have experience with multiple programming languages such as Java, Python, and C++.

  • I am constantly learning and improving my skills through personal projects and online courses.

Q4. What is PLSQL? what are the mail components in PLSQL explain their work with example?

Ans.

PLSQL is a procedural extension of SQL used in Oracle databases for writing stored procedures and functions.

  • Main components: variables, control structures, cursors, exceptions

  • Variables: used to store data within PLSQL programs

  • Control structures: used for conditional logic and looping

  • Cursors: used to process individual rows returned by SQL queries

  • Exceptions: used for error handling and custom error messages

Are these interview questions helpful?

Q5. What are the types of clauses used in SQL and their work

Ans.

Types of clauses in SQL include SELECT, WHERE, GROUP BY, HAVING, ORDER BY, JOIN, etc.

  • SELECT: Retrieves data from a database

  • WHERE: Filters records based on specified conditions

  • GROUP BY: Groups rows that have the same values into summary rows

  • HAVING: Filters groups based on specified conditions

  • ORDER BY: Sorts the result set in ascending or descending order

  • JOIN: Combines rows from two or more tables based on a related column

Q6. Rate yourself in 5 different programming languages on a 1-10 scale, 10 being the best.

Ans.

I rate myself differently in different languages based on my experience and proficiency.

  • Java - 8: I have worked on multiple projects using Java and have a good understanding of its concepts.

  • Python - 7: I have used Python for scripting and automation tasks and have a decent understanding of its libraries.

  • C++ - 6: I have basic knowledge of C++ and have implemented some algorithms using it.

  • JavaScript - 8: I have worked on web development projects using JavaScript and its framewo...read more

Share interview questions and help millions of jobseekers 🌟

man-with-laptop

Q7. What is deadlock condition in multi threading and how to prevent it?

Ans.

Deadlock in multithreading occurs when two or more threads are waiting for each other to release resources, causing them to be stuck indefinitely.

  • Deadlock can be prevented by using proper synchronization techniques like avoiding nested locks, using timeouts, and implementing a deadlock detection algorithm.

  • One common example of deadlock is the dining philosophers problem, where multiple philosophers are sitting at a table with chopsticks and can only eat if they have both chop...read more

Q8. How would you find the second-largest element in an array if you are not allowed to sort the array, or traverse the array more than once?

Ans.

Use two variables to keep track of the largest and second-largest elements while traversing the array once.

  • Initialize two variables to store the largest and second-largest elements.

  • Iterate through the array and update the variables accordingly.

  • Return the second-largest element once the iteration is complete.

Trainee Programmer Jobs

Trainee Programmer Web 0-1 years
Wildgrube Software Private Limited
4.5
Hyderabad / Secunderabad
Trainee Programmer Delphi 0-2 years
Wildgrube Software Private Limited
4.5
Hyderabad / Secunderabad

Q9. What is static data members and static member functions in C++?

Ans.

Static data members and member functions are shared by all objects of a class.

  • Static data members are declared with the static keyword and have a single copy shared by all objects of the class.

  • Static member functions are also declared with the static keyword and can be called without an object of the class.

  • Static data members can be used to maintain a common value across all objects of the class.

  • Static member functions can be used to perform operations that do not depend on t...read more

Q10. Write a program using any language of your choice (It was a palindrome-based program.)

Ans.

A program to check if a given string is a palindrome or not.

  • Take input string from user

  • Reverse the string

  • Compare the reversed string with the original string

  • If both are same, then the string is a palindrome

  • Else, the string is not a palindrome

Q11. how will calculate the required speed for a basketball shoot to reach the basket?

Ans.

The required speed for a basketball shoot to reach the basket can be calculated using the projectile motion formula.

  • Determine the distance between the shooter and the basket

  • Calculate the angle of release

  • Use the projectile motion formula to calculate the required speed

  • Adjust for air resistance and other factors if necessary

Q12. if two coordinates of a rectangle are given find the other two?

Ans.

To find the other two coordinates of a rectangle, we need to use the formula of opposite sides being equal.

  • Calculate the difference between the given coordinates to find the length and width of the rectangle

  • Add or subtract the length and width from the given coordinates to find the other two coordinates

  • Make sure to check if the rectangle is oriented horizontally or vertically

  • Example: Given coordinates (1,1) and (4,5), the length is 4-1=3 and the width is 5-1=4. The other two ...read more

Q13. where did you learn about programming languages

Ans.

I learned about programming languages through various sources.

  • I took computer science courses in high school and college.

  • I read books and online tutorials on programming languages.

  • I practiced coding through personal projects and internships.

  • I attended coding bootcamps and workshops to learn new languages.

  • I learned from experienced programmers through mentorship and collaboration.

Q14. How will you make c++ function blueprint callable in unreal?

Ans.

C++ function blueprint can be made callable in Unreal by creating a Blueprint Function Library.

  • Create a new Blueprint Function Library in Unreal

  • Add the C++ function to the library as a static function

  • Compile the C++ code and refresh the library in Unreal

  • The function can now be called from any Blueprint in the project

Q15. what programing language do u know and rate yourself out of 10

Ans.

I am proficient in Java and Python, rating myself 8 out of 10 in both languages.

  • Proficient in Java and Python

  • Rate myself 8 out of 10 in both languages

  • Have experience in developing applications using Java and Python

Q16. write a C program to find maximum and minimum of given 3 numbers

Ans.

Program to find maximum and minimum of 3 numbers in C

  • Use if-else statements to compare the numbers

  • Initialize variables to store maximum and minimum values

  • Consider using arrays to store the numbers for easier comparison

Q17. What is database management system ?

Ans.

A database management system is a software that manages and organizes data in a database.

  • DBMS is used to create, modify, and delete data in a database.

  • It provides a way to store and retrieve data efficiently.

  • Examples of DBMS include MySQL, Oracle, and Microsoft SQL Server.

Q18. What is API?

Ans.

API stands for Application Programming Interface. It is a set of protocols, routines, and tools for building software applications.

  • API allows different software applications to communicate with each other

  • It defines how software components should interact

  • APIs can be public or private

  • Examples of APIs include Google Maps API, Twitter API, and Facebook API

Q19. What is encapsulation?

Ans.

Encapsulation is the process of hiding implementation details and restricting access to an object's properties and methods.

  • Encapsulation helps in achieving data abstraction and information hiding.

  • It prevents unauthorized access to an object's internal state.

  • It allows for better control over the object's behavior.

  • Example: A bank account class with private variables for balance and account number.

  • Example: A car class with private variables for speed and engine temperature.

Frequently asked in, ,

Q20. Why C is called middle level language?

Ans.

C is called middle level language because it combines features of both high-level and low-level languages.

  • C allows low-level manipulation like memory management and bit manipulation.

  • C also supports high-level features like functions, data structures, and dynamic memory allocation.

  • C is closer to the hardware compared to high-level languages like Java or Python, but not as close as low-level languages like assembly.

  • C provides a good balance between performance and flexibility.

Q21. What is current location

Ans.

Current location refers to the physical position of a person or object at a given moment.

  • Current location can be determined using GPS technology or by manually inputting the address.

  • It is often used in navigation apps, social media check-ins, and emergency services.

  • Examples of current location include '123 Main Street, Anytown, USA' or 'Latitude: 37.7749, Longitude: -122.4194'.

Q22. What are primary and secondary goals

Ans.

Primary goals are main objectives to be achieved, while secondary goals are additional objectives that support the primary goals.

  • Primary goals are the main objectives that an individual or organization aims to achieve.

  • Secondary goals are additional objectives that support the primary goals.

  • Primary goals are usually more critical and have higher priority than secondary goals.

  • Examples: Primary goal of a company may be to increase revenue, while a secondary goal may be to improv...read more

Q23. What are the ways of creating thread

Ans.

Ways of creating threads include extending the Thread class, implementing the Runnable interface, and using Executor framework.

  • Extending the Thread class: Create a new class that extends the Thread class and override the run() method.

  • Implementing the Runnable interface: Create a class that implements the Runnable interface and implement the run() method.

  • Using Executor framework: Create a thread pool using Executor framework and submit tasks to it for execution.

Q24. Write a program to print a matrix of 3 by 3.

Ans.

Program to print a 3x3 matrix using nested loops.

  • Use nested loops to iterate through rows and columns of the matrix.

  • Initialize a 2D array with 3 rows and 3 columns to store the matrix elements.

  • Print the elements of the matrix using nested loops.

Q25. How jdbc works drives of jdbc?

Ans.

JDBC (Java Database Connectivity) is a Java API that allows Java programs to interact with databases.

  • JDBC uses a driver manager to load the appropriate driver for the specific database being accessed.

  • It establishes a connection to the database using the DriverManager class.

  • SQL queries are executed using Statement, PreparedStatement, or CallableStatement objects.

  • ResultSets are used to retrieve data from the database.

  • Transactions can be managed using Connection objects.

Q26. What is oop? And its concepts

Ans.

OOP stands for Object-Oriented Programming, a programming paradigm based on the concept of objects.

  • OOP focuses on creating objects that contain data and methods to manipulate that data.

  • Key concepts include encapsulation, inheritance, and polymorphism.

  • Encapsulation involves bundling data and methods that operate on the data into a single unit.

  • Inheritance allows classes to inherit attributes and methods from other classes.

  • Polymorphism allows objects to be treated as instances o...read more

Q27. difference between while loop and for loop

Ans.

While loop is used when the number of iterations is not known beforehand, while for loop is used when the number of iterations is known.

  • While loop checks the condition before executing the block of code, while for loop initializes, checks condition, and increments/decrements in one line.

  • For loop is used when the number of iterations is known, while loop is used when the number of iterations is not known.

  • Example: while loop - while(i < 5) { //code } for loop - for(int i=0; i<5...read more

Q28. tell me about functions in c

Ans.

Functions in C are blocks of code that perform a specific task and can be called multiple times within a program.

  • Functions in C are defined using a return type, function name, parameters, and a body enclosed in curly braces.

  • Functions can be called multiple times within a program to perform the same task without rewriting the code.

  • Functions can return a value using the 'return' statement.

  • Functions can also be void, meaning they do not return a value.

  • Example: int add(int a, int...read more

Q29. tell me the tech stack used

Ans.

Our tech stack includes Java, Spring Boot, React, and MySQL.

  • Java

  • Spring Boot

  • React

  • MySQL

Q30. what is a string in C.

Ans.

A string in C is a sequence of characters stored as an array of characters terminated by a null character.

  • Strings in C are actually arrays of characters.

  • Strings are terminated by a null character '\0'.

  • Strings can be initialized using double quotes, e.g. char str[] = "Hello".

Q31. Difference between hashset and linkedhashset

Ans.

HashSet is an unordered collection while LinkedHashSet maintains insertion order.

  • HashSet does not maintain insertion order, LinkedHashSet maintains insertion order.

  • HashSet does not allow duplicate elements, LinkedHashSet allows duplicate elements.

  • HashSet uses hashing mechanism to store elements, LinkedHashSet uses a doubly linked list to maintain order.

Q32. What is wrapper class?

Ans.

Wrapper class is a class that wraps around a primitive data type and provides additional methods and functionalities.

  • Wrapper classes in Java are used to convert primitive data types into objects.

  • They provide methods to perform various operations on the data, such as conversion, comparison, and manipulation.

  • Examples of wrapper classes in Java include Integer, Double, Boolean, etc.

Q33. Life cycle of servlet &amp; jsp?

Ans.

Servlet and JSP have different life cycles. Servlet is initialized, service method is called, and then destroyed. JSP is translated to servlet, initialized, service method is called, and then destroyed.

  • Servlet life cycle: Initialization, service method invocation, destruction.

  • JSP life cycle: Translation to servlet, initialization, service method invocation, destruction.

Q34. what is a primary key

Ans.

A primary key is a unique identifier for each record in a database table.

  • Uniquely identifies each record in a table

  • Cannot contain null values

  • Can consist of one or multiple columns

  • Used to establish relationships between tables

Q35. Preferable Programing Languages.

Ans.

Preferable programming languages depend on the project requirements and team expertise.

  • Consider the project requirements and choose a language that best fits them.

  • Consider the team's expertise and choose a language that they are comfortable with.

  • Popular languages include Java, Python, C++, JavaScript, and Ruby.

  • For web development, JavaScript and its frameworks like React and Angular are popular.

  • For data science, Python and R are popular.

  • For mobile app development, Java and Sw...read more

Q36. What is pointer What is inheritance?

Ans.

A pointer is a variable that stores the memory address of another variable. Inheritance is a mechanism in object-oriented programming where a new class inherits properties and behaviors from an existing class.

  • Pointer is used to store memory address of a variable

  • Pointer can be dereferenced to access the value stored at that memory address

  • Example: int *ptr; ptr = # *ptr = 10; // num now has value 10

  • Inheritance allows a new class to inherit properties and behaviors from an exist...read more

Q37. What are packages?

Ans.

Packages are a way of organizing classes and interfaces in a logical structure in Java.

  • Packages help in avoiding naming conflicts by grouping related classes and interfaces together.

  • Packages can be nested within other packages.

  • Packages are declared using the 'package' keyword at the beginning of a Java file.

  • Example: 'package com.example.myproject;'

Q38. difference between break and continue.

Ans.

Break is used to exit a loop, while continue is used to skip the current iteration and move to the next one.

  • Break is used to terminate the loop and exit it completely.

  • Continue is used to skip the current iteration and move to the next one.

  • Example: for(int i=0; i<5; i++) { if(i==3) { break; } System.out.println(i); } // Output: 0 1 2

  • Example: for(int i=0; i<5; i++) { if(i==3) { continue; } System.out.println(i); } // Output: 0 1 2 4

Q39. Any programming language Data types

Ans.

Programming languages have various data types such as integers, floats, strings, and booleans.

  • Data types define the type of data that can be stored in a variable.

  • Common data types include integers, floats, strings, and booleans.

  • Some programming languages also have more complex data types like arrays, structures, and classes.

  • Data types can affect the performance and memory usage of a program.

  • Examples of data types in different programming languages: int in C++, float in Python...read more

Q40. What is algorithm

Ans.

An algorithm is a step-by-step procedure for solving a problem or accomplishing a task.

  • An algorithm is a set of instructions that are followed to solve a problem.

  • It is a sequence of well-defined steps that can be executed in a specific order.

  • Algorithms can be represented using flowcharts, pseudocode, or programming languages.

  • Examples of algorithms include sorting algorithms like bubble sort and searching algorithms like binary search.

Q41. Explain oops concepts

Ans.

OOPs concepts are the principles of Object-Oriented Programming that help in designing and implementing software systems.

  • Encapsulation - bundling of data and methods that operate on that data

  • Inheritance - ability of a class to inherit properties and characteristics from a parent class

  • Polymorphism - ability of an object to take on many forms

  • Abstraction - hiding the implementation details and showing only the functionality

  • Example: A car is an object that has properties like col...read more

Frequently asked in, ,

Q42. Create table syntax in DBMS

Ans.

Creating a table in a DBMS

  • Use CREATE TABLE statement

  • Specify table name and column names with data types

  • Add constraints like primary key, foreign key, etc.

  • Example: CREATE TABLE employees (id INT PRIMARY KEY, name VARCHAR(50), age INT)

  • Execute the statement to create the table

Q43. Java is fully oops concept?

Ans.

Java is a fully object-oriented programming language.

  • Java supports all four pillars of OOP: encapsulation, inheritance, polymorphism, and abstraction.

  • Classes and objects are fundamental concepts in Java.

  • Java allows for the creation of user-defined classes and objects.

  • Inheritance enables code reusability in Java.

  • Polymorphism allows objects to be treated as instances of their parent class.

  • Abstraction allows for hiding implementation details and showing only necessary features t...read more

Q44. explain the concepts of oops

Ans.

OOPs stands for Object-Oriented Programming. It is a programming paradigm based on the concept of objects.

  • OOPs focuses on creating objects that contain data and methods to manipulate that data.

  • Encapsulation is the concept of bundling data and methods that operate on the data within a single unit, called an object.

  • Inheritance allows a class to inherit properties and behavior from another class.

  • Polymorphism allows objects to be treated as instances of their parent class, enabli...read more

Q45. write code for string reverse

Ans.

Code to reverse a string using array of characters

  • Use two pointers, one at the beginning and one at the end of the string

  • Swap characters at the two pointers and move them towards the center until they meet

  • Example: Input 'hello' -> Output 'olleh'

Q46. Write a abstraction program

Ans.

Abstraction program hides implementation details and shows only necessary information.

  • Abstraction is a way to achieve data hiding and encapsulation

  • It helps in reducing complexity and increases efficiency

  • Example: A car dashboard shows only necessary information like speed, fuel level, etc. and hides the implementation details of the engine

  • Abstraction can be achieved through abstract classes and interfaces

Q47. Difference between java and c

Ans.

Java is an object-oriented language while C is a procedural language.

  • Java is platform-independent while C is platform-dependent.

  • Java has automatic garbage collection while C requires manual memory management.

  • Java has built-in support for multithreading while C does not.

  • Java has a larger standard library compared to C.

  • Java is more secure than C due to its strong type checking and exception handling.

  • C is faster than Java in terms of execution speed.

  • C is commonly used for system...read more

Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Interview experiences of popular companies

3.7
 • 10.4k Interviews
3.8
 • 5.6k Interviews
3.1
 • 22 Interviews
3.6
 • 15 Interviews
1.2
 • 1 Interview
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

Trainee Programmer 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