Robert Half Assessment Test IT and Programming Concepts 3 — Questions and Answers
Question 1: What is the difference between a compiler and an interpreter?
- A compiler runs code line by line; an interpreter translates the whole program first
- A compiler translates the whole program before execution; an interpreter executes code line by line (Correct answer)
- They are the same thing with different names
- A compiler only works with low-level languages
Correct answer: A compiler translates the whole program before execution; an interpreter executes code line by line
A compiler converts entire source code to machine code before running, while an interpreter translates and executes one line at a time.
Question 2: In networking, what is the function of a firewall?
- To increase internet connection speed
- To monitor and filter incoming and outgoing network traffic based on rules (Correct answer)
- To assign IP addresses to devices on a network
- To encrypt all data stored on a server
Correct answer: To monitor and filter incoming and outgoing network traffic based on rules
A firewall enforces security policies by allowing or blocking traffic based on predefined rules.
Question 3: Which of the following best describes cloud computing?
- Running software only on local machines without an internet connection
- Delivering computing services like storage and processing over the internet (Correct answer)
- Using physical servers located in the same building
- A type of encryption algorithm
Correct answer: Delivering computing services like storage and processing over the internet
Cloud computing delivers on-demand computing resources — servers, storage, databases, networking — over the internet.
Question 4: What is a binary search algorithm most useful for?
- Sorting an unsorted list of items
- Searching for a value in a sorted list efficiently (Correct answer)
- Removing duplicate entries from a dataset
- Converting decimal numbers to binary
Correct answer: Searching for a value in a sorted list efficiently
Binary search repeatedly halves the search space, making it O(log n) efficient — but it requires the list to be sorted first.
Question 5: What does 'debugging' refer to in software development?
- Writing initial code for a new feature
- Optimizing code to run faster
- Identifying and fixing errors or defects in code (Correct answer)
- Deploying code to a staging environment
Correct answer: Identifying and fixing errors or defects in code
Debugging is the process of finding, isolating, and resolving bugs or unexpected behavior in software.
Question 6: In HTML, which tag is used to create a hyperlink?
- <link>
- <a> (Correct answer)
- <href>
- <url>
Correct answer: <a>
The <a> (anchor) tag with an href attribute creates clickable hyperlinks in HTML.
Question 7: What is the purpose of an index in a relational database?
- To store backup copies of the data
- To speed up data retrieval operations on a table (Correct answer)
- To enforce referential integrity between tables
- To encrypt sensitive columns
Correct answer: To speed up data retrieval operations on a table
A database index creates a data structure that allows faster lookups, similar to a book's index pointing to page numbers.
What is the difference between a compiler and an interpreter?