{"id":18458363,"url":"https://github.com/borjamrd/turing-angular-questions","last_synced_at":"2026-02-09T21:32:59.242Z","repository":{"id":181191213,"uuid":"666378831","full_name":"borjamrd/turing-angular-questions","owner":"borjamrd","description":"Angular interview questions for Turing.","archived":false,"fork":false,"pushed_at":"2023-07-14T11:16:19.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-26T20:24:14.400Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/borjamrd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-07-14T11:14:53.000Z","updated_at":"2024-09-11T13:37:16.000Z","dependencies_parsed_at":"2023-07-14T12:27:43.019Z","dependency_job_id":"cd579072-ae31-4b0a-a1ac-3568329dfe2b","html_url":"https://github.com/borjamrd/turing-angular-questions","commit_stats":null,"previous_names":["borjamrd/turing-angular-questions"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/borjamrd/turing-angular-questions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borjamrd%2Fturing-angular-questions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borjamrd%2Fturing-angular-questions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borjamrd%2Fturing-angular-questions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borjamrd%2Fturing-angular-questions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/borjamrd","download_url":"https://codeload.github.com/borjamrd/turing-angular-questions/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borjamrd%2Fturing-angular-questions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29281966,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-09T19:05:41.198Z","status":"ssl_error","status_checked_at":"2026-02-09T19:05:37.449Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T08:18:10.849Z","updated_at":"2026-02-09T21:32:59.226Z","avatar_url":"https://github.com/borjamrd.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"## Turing angular interview\n\n\u003e Important: here are some questions that I answer during my Turing interview for Angular. I passed it with 80% of correct answers but I couldn't note which were correct and which no. **Please, feel free to make any changes or pull request.**\n\n1. Which form control class name is set to true when value is modified?\n\n   `ng-dirty`\n\n---\n\n2. Given the following code\n   ```\n   @ViewChild('element', {static: false}) elementRef: ElementRef\n   ```\n   Which of the following is the correct location the viewchild elementRef available for usage in Angular?\n   ==i didn't have time to write the possible answers==.\n\n---\n\n3. Consider the following code definition of the DemoModule\n   ```\n   @NgModule({\n   imports: [CommonModule]\n   })\n   export class DemoModule {\n       static forRoot(): ? {\n           return {\n               ngModule: DemoModule,\n               providers: [DemoService]\n           };\n       }\n   }\n   ```\n\n- [ ] LazyLoadedModule\n- [x] ModuleForRoot\n- [ ] ModuleWithProviders\n- [ ] Observable\u003cNgModule\u003e\n- [ ] None of the above\n\n---\n\n4. When you chain multiple pipes together, what order will they be executed?\n\n- [ ] LIFO ORDER\n- [ ] In parallel\n- [x] In the order that you specify them\n- [ ] None of the above\n\n---\n\n5. You are using Angular to develop a Web application, you need to send data of an Observer to its subscribers. Which method can you use?\n\n- [ ] emit()\n- [x] next()\n- [ ] send()\n- [ ] publish()\n\n---\n\n1. Which of the following wild cards can you use to define a “page not found” route?\n\n- [ ] -\n- [x] \\*\\*\n- [ ] 404\n- [ ] ^\n\n---\n\n7. You are using Angular to develop a Web application. You want to extract route parameters inside a component. Which service can support you to do it?\n\n- [ ] Router\n- [ ] RouterLink\n- [ ] RouterLinkActive\n- [x] ActivatedRoute\n\n---\n\n8. What is correct answer about Subject and Behaviour Subject in RxJS?\n\n- [ ] Once you unsubscribe, BehaviourSubject can be reused and Subject can not\n- [ ] If you unsubscribe to a Subject or Behaviour Subject, you will be able to get the current value or initial value\n- [ ] You have to define a default value whenever you declare Behaviour Subject based upon the data type.\n- [x] In Subject, each next subscriber receives only the upcoming values. In Behaviour Subject, each next subscriber receives one previos value and upcoming values.\n\n---\n\n9. Which of the following is TRUE about the kinds of directives in Angular?\n\n- [x] Structural and Attribute directives\n- [ ] Component, Structural and Attribute directives\n- [ ] Component, Template, Structural and Attribute directives\n- [ ] Only one directive\n\n---\n\n10. What is the expected behaviour of the following code?\n\n    ```\n        import {Component} from \"@angular/core\"\n    import {of} from \"rxjs\";\n\n    @Component({\n            selector: \"app-root\",\n            template: \"\u003ch1\u003eCount:{{name$ | async }}\u003c/h1\u003e\"\n    })\n\n    export class AppComponent {\n        count$ = of(NaN);\n    }\n    ```\n\n- [ ] Change detection is triggered and this error occurs: Expression has changed after it was checked.\n\n- [x] The app displays Count: NaN.\n- [ ] A compile error is thrown: type number is not assignable to type string.\n- [ ] A compie error is thrown: Can't create Observable out of NaN.\n\n---\n\n11. What happens when injecting a service to the constructor without access modifier (private, public or protected) or readonly?\n\n- [x] Program compile succesfully and work normally //probada\n- [ ] Compilation error\n- [ ] Compilation success but the page is blank\n\n---\n\n12. Which of the following is TRUE about ngOnInit? (select all that apply)\n\n- [x] ngOnInit is a life cycle hook that is called by Angular\n- [ ] The ngOnInit is called after the constructor is executed\n- [ ] The ngOnInit can be call many time in Angular life cycle\n\n  ***\n\n13. You are using Angular to develop the web application. You want to use HttpClient service in the project. How can you do?\n\n- [ ] HttpModule\n- [ ] Http\n- [x] HttpClientModule // creo\n- [ ] None of the avove\n\n14. Following the source code:\n\n    ```\n    @component({\n        selector: 'my-svg',\n        ,\n        styleUrls: [`.svg/.component.css`]\n    })\n    ```\n\n    how can you use this SVG template?\n\n- [ ] templateUrl: './svg.component.svg'\n- [ ] template: './svg.component.svg',\n- [x] template: `\u003csvg *svgTemplate\u003e\u003cpath [d]=\"validPath\"/\u003e\u003c/svg\u003e`,\n- [ ] vgTemplate: `\u003csvg\u003e\u003cpath [d]=\"validPath\"/\u003e\u003c/svg\u003e`\n\n---\n\n15. Which of the following is incorrect statement about Pipe in Angular?\n\n- [x] Pipes are impure by default\n- [ ] There are 2 types of pipes: pure and impure\n- [ ] Angular executes a pure pipe only when it detects a pure change to the input value\n- [ ] None of the above\n\n---\n\n16. Which of the following is TRUE about the Subjects are multicast?\n\n- [ ] They can be defined with multiple data types.\n- [x] They broadcast notifications to one or more subscribers.\n- [ ] They can support Web sockets for communication with the server.\n- [ ] They support bi-directional communication\n\n---\n\n17. Which of the following helps style child component from parent component’s style file?\n\n- [ ] ::ng-deep\n- [ ] /deep/\n- [ ] Encapsulation mode\n- [x] All of the above\n\n18. What is the expected behavior of the following code?\n\n    ```\n    import {Component} from '..core'\n    import {of} ....\n\n    @Component({\n        selector: 'app-root',\n        template: '\u003ch1\u003eCount: {{count$ | async}}\u003c/h1\u003e'\n    })\n    export class AppComponent {\n        count$ = of(NaN)\n    }\n    ```\n\n- [x] The app displays Count: NaN.\n\n---\n\n19. You are developing a Web application. You need to get data from parent component to child component. How can you do it?\n\n- [x] Using @Input\n- [ ] using @Viewchild\n- [ ] Using service\n- [ ] All of above\n- [ ] None of the above\n\n---\n\n20. In Angular lifecycle, which method is called the first when an Angular class component is created?\n\n- [x] constructor()\n- [ ] ngOnInit()\n- [ ] ngOnChanges()\n- [ ] ngAfterViewInit()\n\n---\n\n21. Which directive can you use if you want to display views for a given router?\n\n- [x] RouterOutlet\n- [ ] RouterLink\n- [ ] RouterLinkActive\n- [ ] RouterState\n\n---\n\n22. How can you use ngFor and ngIf in the same div or tag in Angular?\n\n- [x] No way, angular just support use ngFor or ngIf in one dive or tag\n- [ ] By default, angular supponer both in the same div or tag\n- [ ] By using ng-container or ng-template\n- [ ] None of the above\n\n---\n\n23. What is correct answer about ReplaySubject and BehaviourSubject in RxJS?\n\n- [ ] both will return the initial value or the current value on Subscription\n- [ ] ReplaySubject will not take any initial value\n- [ ] When initializig, BehaviourSubject is not required initial value.\n- [x] None of the above.\n\n---\n\n24. Which of the following is the correct statement about Promise and Observable in Angular?\n\n- [ ] Promise and Observable work with multiple values over time\n- [ ] Promise use Reactive Extensions\n- [ ] Promise cancellable\n- [x] Observable is array whose items arrive asynchronously over time.\n\n---\n\n25. When using Reactive forms which is/are the recommended form(s) of binding data to a controller?\n\n- [ ] [(ngModel)]\n- [x] [formControl]=\"nameOfControl\"\n- [ ] reactiveControlName=\"nameOfControl\"\n- [ ] All of the above.\n\n---\n\n26. You are using Angular to develop a Web application. In the case the data model is updated outside the Zone, you need to update the view. How can you do it?\n\n- [ ] Using the ApplicationRef.prototype.forceUpdate\n- [ ] Using NgZone.prototype.update\n- [ ] Using the ChangeDetectorRef.prototype.detectChanges\n- [x] None of the above.\n\n---\n\n27. Wich of the following Angular synstaxes are used for grouping elements when using structural directive (*ngFor, *ngIf)?\n\n- [ ] ng-group\n- [x] ng-container\n- [ ] ng-template\n- [ ] ng-item\n\n---\n\n28. Which of the following is the correct statement about the Hook called to indicate that completed creating the component?\n\n- [ ] ngAfterViewInit\n- [ ] ngAfterContentInit\n- [ ] ngAfterViewChecked //creo\n- [ ] ngOnInit\n\n---\n\n29. Which of the following are ways to build forms in Angular?\n\n- [ ] model-drive and interface-drive\n- [ ] interface-driven and template-drive\n- [ ] modular-driven and template-driven\n- [x] template-driven and model-driven\n      ==he I'm not plenty sure if the possible answers provided are correct==.\n\n---\n\n30. Which following is the most efficient to compile in Angular?\n\n- [x] Ahead-of-Time (AOT) //Creo\n- [ ] Just-in-Time (JIT)\n- [ ] None of the above\n\n---\n\n31. Given the following code:\n\n    ```\n    @Directive({selector: '[...]'})\n    export class HighlightDirective {\n        constructor(el: ElementRef){\n            //code here\n        }\n    }\n    ```\n\n    how do you make the background color of an element to be red?\n\n- [x] el.nativeElement.style.backgroundColor = \"red\"\n- [ ] el.nodeMode.style.backgroundColor = \"red\"\n- [ ] el.withCSS({style: {backgroundCOlor: 'red'}})\n- [ ] el.domNode.style.backgroundColor = \"red\"\n\n---\n\n32. What is the correct answer about the function executes a query inner animation element within an animation sequence?\n\n- [x] animateChild\n- [ ] childAnimate\n- [ ] animateInner\n- [ ] none of the above\n\n---\n\n33. Which of the following is the correct statement about the service allows to load new components at the runtime?\n\n- [ ] ComponentFactory\n- [ ] DynamicComponentFactory\n- [x] DynamicFactoryLoader\n- [ ] ComponentFactoryResolver\n\n---\n\n34. You are using Angular to develop a Web application. You are using RxJS to retrieve data via HTTP. Which of the following is TRUE about the time the request submitted to the server?\n\n- [ ] When the code calls the makeRequest method of the observable.\n- [ ] When the object containing the Observable is created.\n- [x] When the Observable is subscribed to.\n- [ ] When the obserable is created.\n\n---\n\n35. Given the following code. Where is the viewchild elementRef available for usage (not undefined)? `@viewChild(’element’,{static: false}) elementRef: ElementRef`\n\n- [x] In ngAfterViewInit\n- [ ] In ngAfterContentInit\n- [ ] In ngOnInit\n- [ ] All of the above\n\n---\n\n36. Point out the incorrect statement about BOM in Angular\n\n- [ ] BOM has W3C Recommended standard specifications\n- [x] BOM can access and manipulate the browser windorw\n- [ ] BOM works a level above web page and includes browser attributes\n- [ ] None of the above\n\n---\n\n37. You are a developer at Turing. You are using Angular to develop the Web Applicatiion. When using FormArray, which of the following is correct syntax that replaces the following syntax?\n\n    `while(formArray.length) formArray.removeAt(0);`\n\n- [x] formArray.clear() //creo\n- [ ] formArray.invalidate()\n- [ ] formArray.removeAll()\n- [ ] formArray.invalid()\n\n---\n\n38. Which of the following is correct statement about the parent class of all Change Detectors?\n\n- [x] ChangeDetector\n- [ ] OnChange\n- [ ] AbstractChangeDetector\n- [ ] All of the above.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborjamrd%2Fturing-angular-questions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fborjamrd%2Fturing-angular-questions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborjamrd%2Fturing-angular-questions/lists"}