Inclusion Criteria:
* Age of 18 to 70 years (both inclusive), at the time of signing the informed consent.
* Body weight ≥ 50 kg and a body mass index (BMI) within the range 18 to 35 kg/m\^2 (both inclusive) at screening.
* Contraceptive use by men and women should be consistent with local regulations regarding the methods of contraception for those participating in clinical trials.
* Non-smoker, former smoker or stable non-smoker for at least 3 months prior to screening. Participants must also have abstained from use of other nicotine containing products for at least 3 months before screening.
* Capable of giving signed informed consent, which includes compliance with the requirements and restrictions listed in the informed consent form (ICF) and in the protocol prior to any clinical trial specific procedure.
Participants without hepatic impairment (Cohort 1) only:
* Overtly healthy as determined by medical evaluation including medical history, physical examination, vital signs and electrocardiogram (ECG).
* Clinically acceptable results of clinical chemistry, hematology, coagulation, and urinalysis at screening.
* No known or suspected hepatic impairment; including at screening, meet all the following criteria, as assessed by central laboratory: a) alanine aminotransferase (ALT) ≤ 1.1 x upper limit of normal (ULN); b) aspartate aminotransferase (AST) ≤ 1.2 x ULN; c) Total serum bilirubin ≤ 1.2 x ULN; d) Serum albumin ≥ lower limit of normal (LLN); e) Prothrombin time ≤ 1.2 x ULN.
* Participant meets the demographic-matching criteria, including body weight (kg) ± 20 % and age ± 15 years of the average of the pooled hepatic impairment cohorts (Cohorts 2 and 3). Attempts will be made to ensure that the male-to-female distribution in Cohort 1, is comparable (i.e., ± 1) to that in the pooled hepatic impairment cohorts (Cohorts 2 and 3).
Participants with impaired hepatic function (Cohorts 2 and 3 only):
* Documented diagnosis of hepatic impairment that meets the criteria for Class A or B of the Child-Pugh classification, with no clinically significant change in disease status within the 28 days prior to the screening visit, as documented by the participant's recent medical history (e.g., no worsening clinical signs of hepatic impairment, no worsening of total bilirubin or prothrombin time by more than 50%).
* Participant is willing and able to abide by the lifestyle guidelines described in the protocol.
Exclusion Criteria:
* Clinically relevant medical condition or malignancy that may significantly alter the absorption, metabolism or elimination of engasertib, constitute a safety risk, or interfere with interpretation of trial results.
* History or evidence of malabsorption, or gastrointestinal surgery or disease that may significantly affect the absorption, distribution, metabolism or excretion of engasertib.
* Known or suspected hypersensitivity to engasertib or any component of its formulation.
* Clinically significant infection or immunodeficiency, including relevant active viral infection.
* Use of prohibited concomitant medications or therapies that may interfere with the pharmacokinetics of engasertib within the protocol-defined period before dosing.
* Use of another investigational drug or participation in another clinical trial within 30 days or 5 half-lives of the prior trial intervention, whichever is longer.
* Clinically significant abnormalities in vital signs, ECG, or renal function that preclude participation.
* Positive screening for alcohol or drugs of abuse, except where a positive drug screen in participants with hepatic impairment can be explained by permitted concomitant medication.
* Positive pregnancy test in a female participant of childbearing potential.
* For Cohorts 2 and 3: clinically relevant disease other than hepatic impairment and its associated manifestations that may affect safety, PK interpretation, or Child-Pugh assessment.
* For Cohorts 2 and 3: potentially infectious liver disease, including hepatitis B or C.
* For Cohorts 2 and 3: hepatic carcinoma, hepatorenal syndrome, predicted life expectancy of less than 1 year, severe portal hypertension, severe ascites requiring frequent paracentesis, severe hepatic encephalopathy, recent gastrointestinal hemorrhage, or previous kidney, liver, or heart transplantation.