refactor: Modernize architecture and apply canonical C++ project layout#2
Open
NoaLand wants to merge 72 commits intotechops-recsys-lateral-hiring:mainfrom
Open
refactor: Modernize architecture and apply canonical C++ project layout#2NoaLand wants to merge 72 commits intotechops-recsys-lateral-hiring:mainfrom
NoaLand wants to merge 72 commits intotechops-recsys-lateral-hiring:mainfrom
Conversation
…e smart pointer instead of base class in C++ to support subclass
…json and from json function instead
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context & Objective
This PR completely modernizes the legacy C++ delivery codebase to serve as a high-quality, realistic assessment tool for Consultant+ level candidates.
The primary goal of this refactoring was to elevate the architectural design, C++ language standards, and project structure to industry best practices, while intentionally preserving (and highlighting) the core business logic "code smells" for candidates to identify during the interview.
Enterprise-Grade C++ Project Structure
include/andsrc/directories across all modules.#include <tw/delivery/service/CartService.h>), preventing header clashes and evaluating the candidate's familiarity with large-scale C++ codebases.CMakeLists.txtto strictly enforce module boundaries usingtarget_include_directorieswithPUBLICandPRIVATEvisibility scopes.Key Architectural & C++ Enhancements
rest/directory and restructured the project into strict layers (core/,dto/,infra/adapters/,service/,app/).nlohmann::json) insideinfra/adapters/.Producthierarchy by introducingstd::shared_ptrandvirtualdestructors.std::move) andstd::string_viewfor zero-copy efficiency.main.cpp's messyswitch-caseinto a scalablestd::unordered_maprouter with robust stream state handling.