Monday, 27 October 2025

Black bud Leet code Interview exam

 2 question

1.on cards
2.


https://leetcode.com/discuss/post/537699/google-onsite-card-game-by-sithis-8w7a/

https://leetcode.com/problems/count-array-pairs-divisible-by-k/description/

https://leetcode.com/problems/check-if-array-pairs-are-divisible-by-k/description/


Saturday, 25 October 2025

parent to child

 Solution 2: Shared service (recommended for complex applications)

For more complex applications, a shared service with an RxJS Subject or BehaviorSubject is a cleaner solution for decoupled communication. 
1. Create a shared service
The service will hold an observable that other components can subscribe to. 
typescript
// dropdown.service.ts
import { Injectable } from '@angular/core';
import { Subject } from 'rxjs';

@Injectable({
  providedIn: 'root'
})
export class DropdownService {
  private dropdownSubject = new Subject<any>();

  // Observable for other components to subscribe to
  dropdownValue$ = this.dropdownSubject.asObservable();

  // Method to be called by child1 when the dropdown changes
  sendDropdownValue(value: any) {
    this.dropdownSubject.next(value);
  }
}
Use code with caution.
2. Send the value from the first child (app-newhire-header-details)
In newhire-header-details.component.ts, inject the service and call its sendDropdownValue() method.
typescript
import { Component } from '@angular/core';
import { DropdownService } from '../dropdown.service'; // Adjust path

@Component({ ... })
export class NewhireHeaderDetailsComponent {
  constructor(private dropdownService: DropdownService) {}

  onDropdownSelectionChange(value: any) {
    this.dropdownService.sendDropdownValue(value);
  }
}
Use code with caution.
3. Subscribe to the event in the second child (app-personal-tab)
In personal-tab.component.ts, inject the service and subscribe to the observable to get the latest value.
typescript
import { Component, OnInit, OnDestroy } from '@angular/core';
import { DropdownService } from '../dropdown.service'; // Adjust path
import { Subscription } from 'rxjs';
import { YourApiService } from './your-api.service'; // Assume you have an API service

@Component({ ... })
export class PersonalTabComponent implements OnInit, OnDestroy {
  private dropdownSubscription: Subscription;

  constructor(private dropdownService: DropdownService, private yourApiService: YourApiService) {}

  ngOnInit() {
    this.dropdownSubscription = this.dropdownService.dropdownValue$.subscribe(selectedValue => {
      if (selectedValue) {
        this.callApi(selectedValue);
      }
    });
  }

  callApi(value: any) {
    this.yourApiService.getData(value).subscribe(
      (response) => console.log('API response for PersonalTab:', response),
      (error) => console.error('API error:', error)
    );
  }

  ngOnDestroy() {
    // Unsubscribe to prevent memory leaks
    if (this.dropdownSubscription) {
      this.dropdownSubscription.unsubscribe();
    }
  }
}
Use code with caution.

Parent to child

 both this child calles in the parent i have challange that in child1 dropdown selection change i need to call api in child2 how to do it <app-newhire-header-details [parentData]="parentData" [formData]="combinedFormData.masterHeader" (formDataChange)="onFormDataReceived('masterHeader', $event)"></app-newhire-header-details> <app-personal-tab [formFields]="tabFormFields[2]" [tabKey]="2" [formData]="combinedFormData.personal" (formDataChange)="onFormDataReceived('personal', $event)" (nextTab)="nextTab()" (prevTab)="prevTab()"> </app-personal-tab>

For child-to-child communication, where a change in one child component triggers an action (like an API call) in a sibling child component, the standard Angular approach is for the parent component to act as a mediator
. A shared service is a more robust solution for complex scenarios or when components are not direct siblings. 
Solution 1: Parent as a mediator
This is the most straightforward and recommended approach for components that are direct siblings under the same parent.
1. Emit an event from the first child (app-newhire-header-details)
In newhire-header-details.component.ts, emit an event when the dropdown selection changes. 
typescript
import { Component, Output, EventEmitter } from '@angular/core';

@Component({ ... })
export class NewhireHeaderDetailsComponent {
  // Add a new @Output for the dropdown change
  @Output() dropdownChange = new EventEmitter<any>();

  onDropdownSelectionChange(value: any) {
    // This method is called by the dropdown's (change) or (selectionChange) event
    this.dropdownChange.emit(value);
  }
}
Use code with caution.
2. Listen to the event in the parent component
The parent component listens for the event from the first child. 
typescript
// parent.component.html
<app-newhire-header-details
  [parentData]="parentData"
  [formData]="combinedFormData.masterHeader"
  (formDataChange)="onFormDataReceived('masterHeader', $event)"
  (dropdownChange)="onHeaderDropdownChange($event)">  <!-- Listen for the dropdownChange event -->
</app-newhire-header-details>

<app-personal-tab
  [formFields]="tabFormFields[2]"
  [tabKey]="2"
  [formData]="combinedFormData.personal"
  [headerDropdownValue]="headerDropdownValue"  <!-- Pass the value to the second child -->
  (formDataChange)="onFormDataReceived('personal', $event)"
  (nextTab)="nextTab()"
  (prevTab)="prevTab()">
</app-personal-tab>
Use code with caution.
In parent.component.ts, implement the event handler and use it to update an input property on the second child.
typescript
// parent.component.ts
import { Component } from '@angular/core';

@Component({ ... })
export class ParentComponent {
  headerDropdownValue: any;

  onHeaderDropdownChange(selectedValue: any) {
    // Save the new value from the first child
    this.headerDropdownValue = selectedValue;
    // The second child will be notified of the change via its @Input()
  }

  // ... other methods
}
Use code with caution.
3. Watch for changes in the second child (app-personal-tab)
The second child needs to receive the value from the parent and take action when it changes.
typescript
import { Component, Input, OnChanges, SimpleChanges } from '@angular/core';
import { YourApiService } from './your-api.service'; // Assume you have an API service

@Component({ ... })
export class PersonalTabComponent implements OnChanges {
  // @Input to receive the value from the parent
  @Input() headerDropdownValue: any;

  constructor(private yourApiService: YourApiService) {}

  ngOnChanges(changes: SimpleChanges) {
    if (changes['headerDropdownValue']) {
      const selectedValue = changes['headerDropdownValue'].currentValue;
      if (selectedValue) {
        // Call your API based on the selected value
        this.callApi(selectedValue);
      }
    }
  }

  callApi(value: any) {
    // Logic to call your API based on the value
    this.yourApiService.getData(value).subscribe(
      (response) => console.log('API response for PersonalTab:', response),
      (error) => console.error('API error:', error)
    );
  }
}
Use code with caution.


Friday, 17 October 2025

Forked join exampl

 Used fork join to call dropdown list

loadDropdownData() {
  forkJoin({
    countries: this.masterservice.GetCountries(),
    divisions: this.masterservice.GetDivisions(),
    locations: this.masterservice.GetLocations()
  }).subscribe({
    next: (res:any) => {
      this.countries = res.countries;
      this.divisions = res.divisions;
      this.locations = res.locations;
      console.log(res);
    },
    error: (err) => {
      console.error('Error loading dropdown data', err);
    }
  });
}

Amiercion ailines interview questions

 1.application monitoring for micrioservices

2.multiple jwt token handling in the api

3.toggle handle in react

4.global error handle in angular

5.charts in react

6.design of ecomerce app using microservices securly

7.build pipeline for microservices.

8.Write a JavaScript function asyncMap(arr, asyncFn) that takes an array and an asynchronous function,

 applies asyncFn to each item in parallel, and returns a Promise that resolves with an array of results in the original order. 

Handle errors so that if any asyncFn fails, asyncMap rejects with that error

9.Write a function that takes an array of integers and returns the length of the longest subarray with consecutive elements (regardless of order). 

For example, [2, 6, 1, 9, 4, 5, 3] should return 6 (for subarray [2, 1, 4, 5, 3, 6]).

10.Given a products table and a sales table, write an SQL query to find products that have never been sold but are still in stock.

Thursday, 16 October 2025

Scoped vs transient vs singleton

 

Transient: every time new object instance created

scoped: once you refresh the service new instance created

singleton: once you restart the application then only new instance created.



Friday, 10 October 2025

Devops

 https://paperlive.in/blog/over-60+-azure-devops-interview-questions-and-answers-to-prepare-for-2025


BDOTalentTRkrAPP interview

 BDOTalentTRkrAPP interview
started with questions DI
1.where will intergate it

2.2 main methods in startup.cs
2.Ienumarable and iquerable
3.ADO .net sql invoke  connect and disconect startagies.
4.code first and db first
5.angular
transfer data
types of data bind
first or firstordefult or singleor default.

interceptor
CHallanging converting old application migrating to latest tech

Azure functions types

SQL
1.indexes
2.unique and primarykey dfrnc
3.functions and procedures

Thursday, 9 October 2025

Interview links c#

 https://www.bytehide.com/blog/csharp-advanced-oops-interview-questions-for-10-years-experienced#What_are_the_differences_between_value_types_and_reference_types_in_C_OOP_How_do_these_differences_impact_memory_management_performance_and_coding_practices

When trying to add data from same table

AFINumber AFIAmount OriginalAFINumber OriginalAFIAmount
2024MSVMX00574-OV1 0.00 2024MSVMX00574 NULL
2024MSVMX00575-OV2 0.00 2024MSVMX00575 NULL
2025HSCIN041092-OV4 1111.00 2025HSCIN041092 NULL

Select T.OriginalAFINumber,T.AFIAmount,T.AFINumber,t.OriginalAFIAmount,O.AFINumber,O.AFIAmount
update T
SET T.OriginalAFIAmount = O.AFIAmount
FROM tbl_afiOverrunAmount_dlt T
INNER JOIN tbl_AFIDetails O 
    ON T.OriginalAFINumber = O.AFINumber
WHERE T.OriginalAFIAmount IS NULL;

Copy to new table

Link
If you want to copy data to an existing table (rather than creating a new table), you should use the INSERT INTO SELECT statement.



SELECT column1, column2, column3, ...
INTO destination_table
FROM source_table;

Wednesday, 8 October 2025

Data Engineering

 http://fa-ewgu-saasfaprod1.fa.ocs.oraclecloud.com/hcmUI/CandidateExperience/en/sites/CX_2001/job/25668/?utm_medium=career+site&utm_source=job+alert

Chubb data engineer

Monday, 6 October 2025

kidney stone?

 Foods that increase kidney stone risk include those high in oxalates (like spinach, nuts, and chocolate), sodium (processed and fast foods), animal protein (red meat, fish), and added sugars (sodas and sugary drinks)Excessive caffeine, alcohol, and certain phosphorus-rich processed foods can also contribute to stone formation. Limiting these items and focusing on a balanced diet can help reduce the risk. 




What is the first symptom of a kidney stone?

Kidney stones form in the kidneys. Symptoms may start as stones move into the ureters. The ureters are thin tubes that let urine pass from the kidneys to the bladder. Symptoms of kidney stones can include serious pain, upset stomach, vomiting, fever, chills and blood in the urine.

Capgemini Interview

 capgemini famous interview question List<int> A = new List<int>(); A.add(1); List<int> B=A; B=new List<int>(); B.Ad...