Bloomberg | Phone | Shuffle Cards
Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2020-06-15Added By Anonymous
Source: Link
Company: Bloomberg
Role: unknown
Interview Stage: Phone
Location: unknown
Year: unknown
Original Experience:
A linked list of cards are given. Write a code, to Shuffle the cards, without using inbuilt shuffle / random functions.
Functionalities :
1. Create a deck of card through linked list
2. Split the deck of cards randomly into 2 subsets
3. Merge the subsets randomly , so that previous order is not maintained
4. Display the deck of cards .
Eg:
I/p Cards: [A,4,6,7,9,K,Q,J,2]
Expected Output:
Create Linked List : [A->4->6->7->9->Q->J->2]
Split List into 3 decks : A->4->6->7 9->Q J->2
Merge the decks randomly : 9->6->7 ->Q ->J->2->4->A
Similiar Problem : Interviewer asked to solve using linked list
Role: unknown
Interview Stage: Phone
Location: unknown
Year: unknown
Original Experience:
A linked list of cards are given. Write a code, to Shuffle the cards, without using inbuilt shuffle / random functions.
Functionalities :
1. Create a deck of card through linked list
2. Split the deck of cards randomly into 2 subsets
3. Merge the subsets randomly , so that previous order is not maintained
4. Display the deck of cards .
Eg:
I/p Cards: [A,4,6,7,9,K,Q,J,2]
Expected Output:
Create Linked List : [A->4->6->7->9->Q->J->2]
Split List into 3 decks : A->4->6->7 9->Q J->2
Merge the decks randomly : 9->6->7 ->Q ->J->2->4->A
Similiar Problem : Interviewer asked to solve using linked list