Robert Half Assessment Test IT and Programming Concepts 2 — Questions and Answers
Question 1: Which data structure uses a LIFO (Last In, First Out) access pattern?
- Queue
- Stack (Correct answer)
- Linked List
- Binary Tree
Correct answer: Stack
A stack follows LIFO order, where the last element added is the first one removed.
Question 2: What does the acronym API stand for?
- Application Protocol Interface
- Application Programming Interface (Correct answer)
- Automated Program Integration
- Advanced Programming Index
Correct answer: Application Programming Interface
API stands for Application Programming Interface, a set of rules allowing software components to communicate.
Question 3: In object-oriented programming, what is encapsulation?
- Inheriting properties from a parent class
- Bundling data and methods into a single unit with restricted access (Correct answer)
- Defining multiple methods with the same name
- Creating multiple instances of a class
Correct answer: Bundling data and methods into a single unit with restricted access
Encapsulation bundles data and the methods that operate on it into a class, hiding internal details.
Question 4: Which SQL statement is used to retrieve data from a database?
- INSERT
- UPDATE
- SELECT (Correct answer)
- DELETE
Correct answer: SELECT
The SELECT statement is used to query and retrieve records from one or more database tables.
Question 5: What is the primary purpose of version control systems like Git?
- To compile source code faster
- To track changes in code and enable collaboration (Correct answer)
- To deploy applications to production servers
- To optimize database queries
Correct answer: To track changes in code and enable collaboration
Version control systems track code history, allow branching, and enable multiple developers to collaborate without conflicts.
Question 6: Which of the following is an example of a NoSQL database?
- MySQL
- PostgreSQL
- MongoDB (Correct answer)
- Oracle
Correct answer: MongoDB
MongoDB is a document-oriented NoSQL database that stores data in flexible JSON-like documents.
Question 7: What does 'responsive design' mean in web development?
- The website loads in under one second
- The layout adapts to different screen sizes and devices (Correct answer)
- The server responds quickly to HTTP requests
- The site uses server-side rendering only
Correct answer: The layout adapts to different screen sizes and devices
Responsive design uses flexible layouts and media queries so a website renders well on desktops, tablets, and phones.
Which data structure uses a LIFO (Last In, First Out) access pattern?