Design a Simple Game using OOD
Asked at Bloomberg · Coding & Leetcode-style Questions · Difficulty: Medium
Design a simple game using object-oriented design (OOD). The game requirements are as follows: You need to design a number guessing game where the system randomly generates a number between 1 and 100. The user needs to keep guessing the number, and after each guess, the system will tell the user if the guessed number is greater than, less than, or equal to the actual number. The game ends when the user guesses correctly. Please provide a complete class design and implement the game logic.
Loading the problem…
More Bloomberg interview questions
- Streaming Social-Media Mentions and Aggregation
- Real-time Market Data Distribution System
- Trade Processor with Subscribe / Unsubscribe
- Flatten a Multilevel Doubly Linked List
- Matchsticks to Square Transform
- Train a Next-Word Predictor from Tokenized Sentences