Search test library by skills or roles
⌘ K

Adaface Sample Data Structures Questions

Here are some sample Data Structures questions from our premium questions library (10273 non-googleable questions).

Skills

🧐 Question

Hard

Graph Traversal and Data Storage
Graph Theory
Algorithm Analysis
Solve
Consider the following pseudo code implementing a specific graph traversal algorithm:
 image
What is the order in which the nodes are processed, and which data structure best represents the graph `G` for efficient traversal?

Medium

Implementing a Browser's Back Button
Stack
Data Handling
Solve
You are tasked with implementing the "Back" button functionality in a web browser. This feature allows users to return to previously visited web pages in the order they were viewed. The browser maintains a history of URLs in a data structure. Considering the nature of web browsing, where users can go back multiple steps and then navigate to a new page (at which point the future history should be cleared), which data structure and algorithm would best implement this functionality?
A: Use a heap, add the current URL when navigating to a new page, and remove the top element when the back button is used.
            B: Use a queue, enqueue the current URL when navigating to a new page, and dequeue when the back button is used.
            C: Use a single stack, push the current URL when navigating to a new page, and pop when the back button is used.
            D: Use an array, add the current URL to the end when navigating to a new page, and remove the last URL when the back button is used.
            E: Use a linked list, add the current URL to the head when navigating to a new page, and move backwards when the back button is used.
            F: Use two stacks, push the current URL to the first stack when navigating to a new page, and use the second stack to store the pages when the back button is used.

Easy

Linked List Element Removal
Linked Lists
Element Removal
Solve
Consider a singly linked list where each node contains an integer value. Write a function `removeElement` that removes all occurrences of a specific value from the linked list. The function should return the head of the modified linked list.
            
            Pseudo code:
 image
What will be the content of the linked list referred to by `result` after executing the above pseudo code?
🧐 Question🔧 Skill

Hard

Graph Traversal and Data Storage
Graph Theory
Algorithm Analysis

3 mins

Data Structures
Solve

Medium

Implementing a Browser's Back Button
Stack
Data Handling

2 mins

Data Structures
Solve

Easy

Linked List Element Removal
Linked Lists
Element Removal

2 mins

Data Structures
Solve
🧐 Question🔧 Skill💪 Difficulty⌛ Time
Graph Traversal and Data Storage
Graph Theory
Algorithm Analysis
Data Structures
Hard3 mins
Solve
Implementing a Browser's Back Button
Stack
Data Handling
Data Structures
Medium2 mins
Solve
Linked List Element Removal
Linked Lists
Element Removal
Data Structures
Easy2 mins
Solve

Trusted by recruitment teams in enterprises globally

Amazon Morgan Stanley Vodafone United Nations HCL PayPal Bosch WeWork Optimum Solutions Deloitte Microsoft NCS Doubtnut Sokrati J&T Express Capegemini

We evaluated several of their competitors and found Adaface to be the most compelling. Great library of questions that are designed to test for fit rather than memorization of algorithms.


Swayam Narain, CTO, Affable

hashtag image heart icon Swayam
customers across world
Join 1200+ companies in 75+ countries.
Try the most candidate friendly skills assessment tool today.
g2 badges
Ready to streamline your recruitment efforts with Adaface?
Ready to streamline your recruitment efforts with Adaface?
logo
40 min tests.
No trick questions.
Accurate shortlisting.
ada
Ada
● Online
Previous
Score: NA
Next
✖️