Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8056463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:42:37+00:00 2026-06-05T08:42:37+00:00

I was asked the following interview-question: Suppose you have a HashSet implementation providing its

  • 0

I was asked the following interview-question:

Suppose you have a HashSet implementation providing its ordinary
interface. How can you use one or more instances of HashSet to
implement a HashTable providing the ordinary HashTable interface it its ordinary time constraints?

I asked twice, but they meant it this way and not the other way around (implementing a HashSet using a HashTable is quite simple, Java does this for example).

I answered that it was not possible. This answer did not seem to statisfy the interviewer, so I am searching for a better answer. I could not find a solution, even when searching on the internet and on Stack Overflow.

I think it was a trick question, but to make sure I post this question here on SO.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T08:42:38+00:00Added an answer on June 5, 2026 at 8:42 am

    One standard way to do this is to treat the hash table as a hash set of key/value pairs, where the hash code of the key/value pair is purely the hash code of the key and the equality comparison function says that any two key/value pairs are equal precisely when their keys are equal. That way, the normal hash set operations will store key/value pairs in a way where

    • No two key/value pairs with the same key are stored, and
    • looking up the key in the hash table will find the key/value pair object with that key, from which the value can be looked up.

    Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was asked following question in interview recently: Let suppose you have, following grid
The following question was asked in one of my interview (few years back) What
In interview I have been asked following question. I tried to answer the question
I have been asked in an interview the following question: What is the default
Recently I was asked the following question at interview. What are the different way
I got asked the following question in an interview while talking about concurrency in
A friend of mine was asked the following question today at interview for the
I have been repeatedly asked the following questions in many interviews.... But still can't
Interview Question I have been asked this question in an interview, and the answer
I was asked the following question in an interview: Is there any way in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.