Showing 1–10 of 19 questions
in Accenture Questions
What is the purpose of Unit Testing?
A
To test entire applications
B
To test individual components or functions
C
To design user interfaces
D
To manage databases
Correct Answer:
B. To test individual components or functions
EXPLANATION
Unit testing involves testing individual units or components of code in isolation to ensure they work correctly.
What is Machine Learning?
A
Programming machines to perform tasks
B
Teaching machines to learn from data and make predictions
C
Manufacturing computers
D
Operating heavy machinery
Correct Answer:
B. Teaching machines to learn from data and make predictions
EXPLANATION
Machine Learning is a subset of AI that enables systems to learn from data and improve performance without explicit programming.
What is an 'Interface' in OOP?
A
A graphical display
B
A contract that specifies methods a class must implement
C
A type of variable
D
A database connection
Correct Answer:
B. A contract that specifies methods a class must implement
EXPLANATION
An interface is an abstract type that defines a set of methods that implementing classes must provide.
What is the difference between '==' and '===' in JavaScript?
A
No difference
B
'==' checks value, '===' checks value and type
C
'==' checks type, '===' checks value
D
'===' is only for strings
Correct Answer:
B. '==' checks value, '===' checks value and type
EXPLANATION
'==' is loose equality (compares value only), while '===' is strict equality (compares both value and type).
What is a 'Constructor' in programming?
A
A method that destroys objects
B
A special method that initializes objects
C
A variable declaration
D
A loop structure
Correct Answer:
B. A special method that initializes objects
EXPLANATION
A constructor is a special method called when an object is created to initialize its properties.
What is the main principle of OOP (Object-Oriented Programming)?
A
Writing code in linear fashion
B
Organizing code into reusable objects with properties and methods
C
Using only functions
D
Avoiding data structures
Correct Answer:
B. Organizing code into reusable objects with properties and methods
EXPLANATION
OOP is based on organizing code into objects that contain both data (properties) and functions (methods).
What is the difference between Stack and Queue?
A
Both are the same
B
Stack uses LIFO, Queue uses FIFO
C
Stack uses FIFO, Queue uses LIFO
D
No structural difference
Correct Answer:
B. Stack uses LIFO, Queue uses FIFO
EXPLANATION
Stack (Last In First Out) removes the most recently added element. Queue (First In First Out) removes elements in the order they were added.
Which sorting algorithm has the worst-case time complexity of O(n^2)?
A
Merge Sort
B
Quick Sort
C
Bubble Sort
D
Heap Sort
Correct Answer:
C. Bubble Sort
EXPLANATION
Bubble sort has a worst-case time complexity of O(n^2) when the array is in reverse order.
What is the time complexity of binary search?
A
O(n)
B
O(n^2)
C
O(log n)
D
O(1)
Correct Answer:
C. O(log n)
EXPLANATION
Binary search has a time complexity of O(log n) because it divides the search space in half with each iteration.
In what order should these sentences be arranged? A) He decided to take a different route. B) The road was blocked. C) John was driving to work. D) He reached office on time.
A
C, B, A, D
B
B, A, C, D
C
C, A, B, D
D
A, B, C, D
Correct Answer:
A. C, B, A, D
EXPLANATION
The logical order is: C (John driving), B (road blocked), A (takes different route), D (reaches on time).