Patient description: The patient is a 24-year-old man who has had type 1 diabetes for 11 years. He presents to the emergency room with hyperglycemia and concern for possible diabetic ketoacidosis after not taking his insulin for 3 days. The patient reports that he is currently homeless and has lost his supply of insulin, syringes, glucometer, and glucose testing supplies. The patient states that at the time of his initial diagnosis with type 1 diabetes he was hospitalized with a glucose value >1000 mg/dL. At the time, he was experiencing polyuria, polydipsia, and polyphagia. He reports that he has been on insulin since the time of his diagnosis, and he has never been prescribed oral agents for diabetes management. Most recently, he has been using insulin glargine 55 units once daily, and insulin aspart sliding scale 3 times daily. The patient has had previous episodes of diabetic ketoacidosis, for which he was hospitalized. With this episode of hyperglycemia, he is not experiencing any nausea, vomiting, or abdominal discomfort, and he appears well. His lab studies showed: A1c: 11.3% Creatinine: 0.9 mg/dL with eGFR >60 mL/min Aspartate aminotransferase (AST): 17 U/L Alanine aminotransferase (ALT): 14 U/L Beta-hydroxybutyrate: 0.1 mmol/L Bicarbonate: 25 mEq/L Anion

Clinical trial eligibility criteria: eligible ages (years): 10.0-17.0,  Diabetes Mellitus, Type 2 Has a confirmed diagnosis of T2DM using American Diabetes Association (ADA) and World Health Organization (WHO) (laboratory determinations of fasting plasma glucose [FPG] greater than or equal to [>=] 126 mg/dL, random glucose >=200 mg/dL [>=11.10 mmol/L], HbA1c >=6.5 percent (%), or 2-hour oral glucose tolerance test [OGTT] glucose >=200 mg/dL), documented in the participants' medical record. 2. The participant and/or his/her legal representative (that is, parents or legal guardians) are able and willing to monitor their own blood glucose concentrations with a home glucose monitor and complete participant diaries  Has a history of hypersensitivity or allergy to alogliptin, other dipeptidyl peptidase-4 (DPP-4) inhibitors, metformin, insulin or related compounds. 2. Has a confirmed diagnosis of type 1 diabetes mellitus or maturity-onset diabetes of the young (MODY). 3. Has a hemoglobin level <11.0 gram per deciliter (g/dL) (<110 gram per liter [g/L]) for males and <10.0 g/dL (<100 g/L) for females. 4. Has a history of any hemoglobinopathy that may affect determination of HbA1c levels. 5. Has a history of bariatric surgery. 6. Has a history of proliferative diabetic retinopathy within the 6 months prior to Screening. 7. Has had more than 1 episode of diabetic ketoacidosis (DKA) at any time after diagnosis of T2DM. 8. Has a history of more than 1 episode of pancreatitis. 9. Has serum creatinine >=1.5 mg/dL for male participants or >=1.4 mg/dL for female participants, or creatinine clearance <60 milliliter per minute (mL/min) based on calculation by central lab using the Schwartz formula for estimated glomerular filtration rate (eGFR) at screening Visit. 10. Has a documented history of infection with human immunodeficiency virus or chronic active viral hepatitis. 11. The participant and/or his/her legal representative (that is, parents or legal guardians) is unable to understand verbal or written English, or any other language for which a certified translation of the approved informed consent/assent is available. Additional That Must be Met Prior to Randomization: For participants who have had the diagnosis of T2DM for less than 1 year and/or who are taking insulin at Screening, additional will need to be met prior to randomization: 1. Must have an HbA1c level of >=6.5% to <11.0% if the participant is treatment naïve or on metformin alone or >=7.0% to <11.0% if the participant is on insulin alone or in combination with metformin. 2. The participant must not have received any investigational compound within 30 days or 5 half-lives, whichever is longer, prior to randomization. 3. Must not have received an antidiabetic agent other than metformin or insulin within the 12 weeks prior to randomization. 4. Must not have received oral or parenteral steroids for more than 3 weeks (cumulatively) within the 6 months prior to randomization or have received a course of oral or parenteral steroids within the 2 months prior to randomization. 5. Has a systolic blood pressure <160 millimeter of mercury (mmHg) and a diastolic pressure <100 mm Hg. (Antihypertensive medications will be allowed during the study). 6. Has an alanine aminotransferase (ALT) level <3*upper limit of normal (ULN) or an ALT level <5 *ULN with a confirmed diagnosis of nonalcoholic fatty liver disease (NAFLD).7. Does not plan to leave the geographic area within 1 calendar year following randomization. For participants who have had the diagnosis of T2DM for less than 1 year and/or who are taking insulin prior to randomization, the following must also be met: 8. Must have a fasting C-peptide concentration>=0.6 nanogram per milliliter (ng/mL) (>=0.20 nanomole per liter [nmol/L]) (drawn at least 1 week after treatment for ketosis or acidosis, if applicable). 9. No presence of autoantibodies as documented by glutamic acid decarboxylase [GAD] 65 and islet antigen [IA]-2 antibodies below the upper limit of the normal reference ranges at randomization. 10. Have a body mass index (BMI) greater than (>) 85th percentile, documented at randomization