DSABeginnerReady

Hashing Assessment

This assessment verifies the Hashing module. Passing it contributes up to 7 points in the 23-29 score band.

Questions

8

Limit

80m

Pass

85%

Score

+7

Question 1multiple-choiceBeginner

8 pts

Hashing cost model precision

Which statement is the strongest professional description of hash-map lookup cost?

Question 2codingBeginner

14 pts

Hash-map lookup and application-code joins

Given orders with userId and users with id/name, return order views with buyerName without scanning the full users list for every order. Include complexity, missing-user behavior, and duplicate-user-ID policy.

Question 3scenarioIntermediate

14 pts

Set-based deduplication and side-effect safety

A payment provider may deliver the same webhook multiple times. Processing a duplicate can send duplicate emails and issue duplicate credits. Design the deduplication strategy and state where an in-memory set is insufficient.

Question 4code-reviewBeginner

12 pts

Choosing set versus counter under product semantics

Review this fraud feature proposal: `suspiciousIps.add(ip)` records IPs with failed logins. Product later asks which IPs have more than 50 failures in 10 minutes. Explain the flaw and propose the right structure.

Question 5codingBeginner

14 pts

Frequency counting with normalization

Given two strings, determine whether they are anagrams after lowercasing and keeping only letters a-z. Explain why normalization must happen before counting and give complexity.

Question 6code-reviewIntermediate

12 pts

Key identity and correctness

Review a cache that stores account settings by `userId`. The product is multi-tenant, and users from different tenants can share the same user ID format. What is the bug, how do you fix it, and why is this not a collision problem?

Question 7scenarioIntermediate

14 pts

Memory lifecycle, TTL, and eviction

A streaming ingestion service wants duplicate suppression for recent event IDs, but unique event IDs can reach hundreds of millions per day. Design a bounded approach and state the trade-off.

Question 8multiple-choiceIntermediate

12 pts

Knowing when hashing is the wrong tool

Which structure selection answer is strongest?