WellDev WCSP Practice Questions for Trainee
Software Engineer
Prepared for Interview Preparation
June 2025
Introduction
This document provides a comprehensive set of practice questions and answers to prepare
for the WellDev Women Career Start Program (WCSP) first-round MCQ and written
test scheduled for June 20, 2025. The questions cover Data Structures and Algorithms
(DSA), Object-Oriented Programming (OOP), Database, Aptitude/Analytical, Problem
Solving/Code Snippets, Networking, and Basic Math, as specified for the trainee-friendly
test.
Data Structures and Algorithms (DSA)
1. What is Binary Search?
Binary Search is an algorithm to find an element in a sorted array by dividing the
search interval in half, with a time complexity of O(log n).
2. How do you find the second highest element in an array?
Traverse the array to find the maximum (max1), then traverse again to find the
largest element less than max1.
3. What is the time complexity of Merge Sort?
Merge Sort has a time complexity of O(n log n) for all cases.
4. Explain the difference between a stack and a queue.
A stack follows Last In, First Out (LIFO), while a queue follows First In, First Out
(FIFO).
5. How do you check if a string is an anagram of another string?
Sort both strings and compare them, or use a hash map to count character frequen-
cies.
6. What is recursion? Give an example.
Recursion is when a function calls itself to solve a smaller problem. Example:
Factorial, where n! = n × (n − 1)!.
7. How do you calculate the cumulative sum of an array?
Iterate through the array, maintaining a running total by adding each element.
1
8. What is the purpose of a linked list?
A linked list is a dynamic data structure for efficient insertion and deletion, with
each node containing data and a reference to the next node.
9. What is the time complexity of finding an element in an array?
O(n) in the worst case, as every element may need to be checked.
10. Explain the concept of time complexity.
Time complexity measures how an algorithms running time grows with input size,
expressed using Big O notation (e.g., O(n), O(log n)).
11. Write a program to reverse a linked list.
1 struct Node {
2 int data ;
3 struct Node * next ;
4 };
5 struct Node * reverseList ( struct Node * head ) {
6 struct Node * prev = NULL , * current = head , * next = NULL ;
7 while ( current != NULL ) {
8 next = current - > next ;
9 current - > next = prev ;
10 prev = current ;
11 current = next ;
12 }
13 return prev ;
14 }
12. Can you implement a stack using queues?
Yes, using two queues. Enqueue to one queue, and for pop, move all but the last
element to the other queue, then dequeue.
Object-Oriented Programming (OOP)
1. What is Object-Oriented Programming (OOP)?
OOP is a programming paradigm based on objects, which combine data and meth-
ods, using concepts like inheritance, polymorphism, encapsulation, and abstraction.
2. What is Abstraction?
Abstraction hides complex implementation details, showing only essential features,
achieved through abstract classes or interfaces.
3. Explain Runtime Polymorphism.
Runtime Polymorphism occurs when a method is called at runtime, determined by
the objects actual type (e.g., method overriding).
4. What is the difference between private and protected access specifiers?
Private members are accessible only within the same class; protected members are
accessible in the class and its subclasses.
2
5. What is a Constructor?
A constructor is a special method that initializes objects, called automatically upon
object creation.
6. Explain Compile-time Polymorphism.
Compile-time Polymorphism is achieved through method overloading, where mul-
tiple methods share the same name but have different parameters.
7. What are the four pillars of OOP?
The four pillars are Abstraction, Encapsulation, Inheritance, and Polymorphism.
8. Can you override a private method in Java?
No, private methods are not visible outside the class and cannot be overridden.
9. Write a Java code snippet demonstrating inheritance.
1 class Animal {
2 void eat () { System . out . println ( " This ␣ animal ␣ eats ␣ food . " )
; }
3 }
4 class Dog extends Animal {
5 void bark () { System . out . println ( " The ␣ dog ␣ barks . " ) ; }
6 }
7 public class Main {
8 public static void main ( String [] args ) {
9 Dog dog = new Dog () ;
10 dog . eat () ;
11 dog . bark () ;
12 }
13 }
Database
1. What is SQL?
SQL (Structured Query Language) is used to manage and manipulate relational
databases, including creating, updating, and querying data.
2. Write an SQL query to find the second highest salary.
SELECT MAX(salary) FROM employees WHERE salary < (SELECT MAX(salary) FROM
employees);
3. What are ACID properties in database transactions?
ACID stands for Atomicity (all or nothing), Consistency (data remains valid), Iso-
lation (transactions dont interfere), and Durability (committed transactions are
permanent).
4. What is the difference between LEFT JOIN and RIGHT JOIN?
LEFT JOIN includes all records from the left table and matched records from the
right table. RIGHT JOIN includes all records from the right table and matched
records from the left table.
3
5. What is an ER diagram?
An ER diagram visually represents entities, attributes, and relationships in a database.
6. What is normalization?
Normalization organizes data to reduce redundancy and improve integrity by di-
viding large tables into smaller, related ones.
7. Write an SQL query to list salaries in descending order.
SELECT salary FROM employees ORDER BY salary DESC;
Aptitude/Analytical
1. A shopkeeper sells a pen at a profit of 20%. If the selling price is Rs 60,
what is the cost price?
Let CP = x. Then SP = 1.2x = 60, so x = 60 / 1.2 = 50 Rs.
2. If all Bats are Balls and some Balls are Gloves, then some Gloves are
Bats. (True/False)
False. The statement does not imply that any Gloves are Bats.
3. Find the next number in the sequence: 2, 4, 8, 16, ?
32 (each number is doubled).
4. Find the odd one out: Apple, Banana, Carrot, Orange.
Carrot (its a vegetable, while the others are fruits).
5. If a car travels at 60 km/h, how far will it travel in 2.5 hours?
Distance = 60 ×2.5 = 150km.
Problem Solving/Code Snippets
1. Write a function to calculate the cumulative sum of an array.
1 def cumulative_sum ( arr ) :
2 result = []
3 total = 0
4 for num in arr :
5 total += num
6 result . append ( total )
7 return result
2. Write a program to check if a string is an anagram.
1 def is_anagram ( str1 , str2 ) :
2 return sorted ( str1 ) == sorted ( str2 )
3. What is the output of the following C code?
4
1 # include < stdio .h >
2 int main () {
3 int x = 10;
4 int y = 20;
5 int z = x + y ;
6 printf ( " % d " , z ) ;
7 return 0;
8 }
Output: 30
4. What is the output of the following Java code?
1 public class Main {
2 public static void main ( String [] args ) {
3 int x = 5;
4 int y = x ++;
5 System . out . println ( x + " ␣ " + y ) ;
6 }
7 }
Output: 6 5
5. Write a program to swap two numbers without using a temporary vari-
able.
1 void swap ( int *a , int * b ) {
2 *a = *a + *b;
3 *b = *a - *b;
4 *a = *a - *b;
5 }
Networking
1. What is DNS?
DNS (Domain Name System) translates domain names into IP addresses.
2. What is the difference between TCP and UDP?
TCP is connection-oriented, reliable, and ordered; UDP is connectionless, unreli-
able, and unordered.
3. What is an API?
An API (Application Programming Interface) allows different software applications
to communicate.
4. What is a subnet?
A subnet is a logical subdivision of an IP network for better management.
5
Basic Math
1. Solve for x: 2x + 5 = 15.
2x = 10, so x = 5.
2. What is the probability of rolling a 6 on a fair six-sided die?
1
6
.
3. Find the greatest common divisor (GCD) of 12 and 18.
GCD = 6.
WellDev-Specific Questions
1. What is Binary Search?
Binary Search finds an element in a sorted array by dividing the search interval in
half, with O(log n) time complexity.
2. Can we make a stack using queues?
Yes, using two queues. Enqueue to one queue, and for pop, move all but the last
element to the other queue, then dequeue.
3. Write an SQL query to find the second highest salary.
SELECT MAX(salary) FROM employees WHERE salary < (SELECT MAX(salary) FROM
employees);
4. Write an SQL query to list salaries in descending order.
SELECT salary FROM employees ORDER BY salary DESC;
5. Which performs better: Linked List or Array?
Arrays are better for random access (O(1)), while linked lists are better for inser-
tions/deletions (O(1) if position is known).
Preparation Tips
• Practice 2030 MCQs daily per topic using resources like GeeksforGeeks and Code-
Quotient.
• For the written test, practice writing pseudocode and tracing code outputs in C
and Java.
• Review WellDev-specific questions on Glassdoor.
• Use GRE/GMAT-style aptitude books for quantitative and analytical practice.
• Familiarize yourself with basic networking concepts and APIs.
6
Resources
• DSA: [Link]
interview-questions-topic-wise/
• OOP: [Link]
• Database: [Link]
questions
• Aptitude: [Link]
companies/
• Networking: [Link]
• WellDev-Specific: [Link]
[Link]