This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Problem: Product Suggestion System | |
* | |
* You’re implementing a product suggestion system for a shopping app. | |
* Given a list of product names and a search query string, return a list of suggestions | |
* after each character is typed, starting from the second character. | |
* | |
* Requirements: | |
* - Suggestions must match the current prefix (case-insensitive) | |
* - Sorted lexicographically |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class OrderProcessor | |
{ | |
public void ProcessOrder(Order order) | |
{ | |
Console.WriteLine("Processing order..."); | |
// Validate order | |
if (order == null || order.Items == null || order.Items.Count == 0) | |
{ | |
Console.WriteLine("Invalid order."); |