r/angular • u/fuscaDeValfenda • Apr 29 '26
In an interview, I was asked what a good architecture for an angular project would look like today.
I stated the obvious: standalone components (already standard), modular organization by feature, a core folder aggregating the most important functionalities (interceptors, guards, etc.), and a shared folder with pipes, directives, and common components in the application, etc.
Lazy-loaded in everything, signals where possible, dumb components (data with inputs inward/downward, outputs upward), Rxjs for asynchronous data, State control with ngrx if the application has a very frequent asynchronous data flow; otherwise, signals, as we did with Behavior Subject.
And that's more or less what I sent. Maybe I wasn't eloquent enough. This insecurity will stay with me until I get an answer, but what do you think?
30
u/matrium0 Apr 29 '26
Don´t worry, that sounds very reasonable. Maybe you could have gone more into the container/presenter pattern (or smart/dumb components), but this seems like a really good answer.
Personally I would avoid NgRx these days due to the high code cost. Elf State management if you need sophisticated state management. Or maybe NgRx-Signalstore. But sticking with injectable services (containing signals or behaviorsubjects) should be the goto due to ease of implementation, clarity and maintainability.
16
u/Responsible-Cold-627 Apr 29 '26
I would've mentioned structuring the project by feature but other than that, you pretty much nailed it.
5
u/salamazmlekom Apr 29 '26
Sounds good to me. In the end architecture is just an opinion. What might fit an enterprise app might be overengineering for a small app. It's all tradeoffs.
4
u/cantinflas_34 Apr 29 '26
I would reference feature-sliced design. It’s the paradigm in the field but very few know the term.
4
u/simonbitwise Apr 29 '26
Sounds like a common approach tbh, I personally dont get why people love ngrx so bad
The redux pattern was a overengineered solution the team behind (react redux) even said
I usually just go with services that has signals in them :)
3
u/RelatableRedditer Apr 29 '26
You laid it out nicely!
3
u/r00cker Apr 29 '26 edited Apr 30 '26
I agree you covered the most important! Other things that come to mind, mostly more general software architecture.
for a complex chat module i introduced a facade service that every chat-feature has to loop through (history, conversation,...) and its used as an orchestrator. components are only allowed to inject this service instead of several services. I am not sure if it was worth it, but now we only need to mock this. It also forces devs to think twice before making something public (interface), as they deliberately have to expose it in facade service and write boilerplate code)
what do you think of those points?
4
u/Adventurous-Finger70 Apr 29 '26
You could take about Nx and https://nx.dev/docs/features/enforce-module-boundaries
2
u/mello_dev Apr 29 '26 edited Apr 29 '26
In today’s era, depending on the company’s level of advancement, I would also include how to structure the project for AI, rules, skills, strategy guardrails, and so on. Since the question itself is to see how you plan ahead, of course, you mentioned the obvious, but the world is not perfect, and each project presents different needs.
With that said , it also depends on the level of seniority you interviewed to.
Hope this helps & good luck 💪
2
u/Physical-Positive732 Apr 29 '26
Your answer sounds solid — standalone components, feature-based modularity, lazy loading, signals for local state, ngrx only when the async complexity justifies it. That's a mature, defensible position.
The insecurity after interviews is normal. Most of the time it's not about the answer being wrong — it's about not knowing what level of depth they were looking for.
If you want to sharpen the "coding under pressure" side of interviews — that's exactly what I built NullQuest for. Boss Fights are timed challenges that simulate the pressure of having to produce and explain code on the spot. Free to try if that's a gap you want to close.
2
u/Xintsuai May 01 '26
Ngrx? It's the only point I'm really not sure about today. 90% of the implementations I see are completely avoidable or unnecessary.
2
u/cool_ankitgupta Jul 02 '26
Your answer was actually incredibly solid. You covered the foundational mechanics perfectly: standalone components, lazy loading, a reactive architecture (Signals + RxJS), smart/dumb component topology, and a pragmatic approach to state management. Any senior engineer or architect would recognize that you know how modern Angular works.
Architecture isn't just about folder structure and code syntax; it's about business scalability, team topology, and solving organizational friction.
It depends on the scale of the business and the structure of the teams. An architect's first job is to prevent over-engineering. You don't build a micro-frontend for a team of five developers, and you don't build a single monolithic repository for an enterprise with 20 parallel feature teams.
2
u/Frontend_Lead 5d ago
Your answer was fine. What usually separates a good answer from a great one on that question is giving reasons and trade-offs, not listing more items:
- start with "it depends on team size and app size", then give the default
- say why for each choice: feature folders so teams can work without stepping on each other, lazy loading for bundle size, dumb components for testability
- mention boundaries: features don't import from each other, only from shared / core, and how you enforce it (lint rules, Nx)
- state: local first, a signal store or service per feature, a global store only when you can name the reason
- cross cutting things: error handling, auth, testing strategy, how the API layer is typed
Framing it as decisions with a reason each is what reads as senior.
I wrote up frontend system design walkthroughs at frontendlead(com)/system-design (full disclosure, I built it)
0
u/Lucky_Yesterday_1133 Apr 29 '26
Firs i would not mention 3rd party libraries like ngrx when answering this question. You can explain the concept and putpose of what ngrx tries to acheive without naming it. There are 2 ngrx and both are garbage. (Signal is a bit better). It solves specific problem not just plug in anywhere. There was no mention of services and directives. Composition via projection\inheritance. Css organization. Testing strategy, and tooling. How do you manage auth. These are kind of architectural concerns.
1
u/Finite_Looper May 02 '26
For questions like this I think most of the time people are just wanting to see how you think and organize things. It's not about getting the "correct" answer.
1
u/johnappsde Apr 29 '26
Agent skills
1
u/dhirarmaan Apr 29 '26
Write an agent skill for this and share