As explained in this answer you may convert the string representation of arrays to real arrays with translate and cast. (As commented you should not store the arrays as strings)
select
_id,
answer,
translate(subquestionid, '[]', '{}')::int[] subquestionid,
translate(subquestionanswer, '[]', '{}')::boolean[] subquestionanswer,
isactive
from test1;
result
_id|answer|subquestionid|subquestionanswer |isactive|
---+------+-------------+-----------------------+--------+
1|true |{100,101,102}|{{true},{false},{true}}|1 |
2|false |{101,106} |{{false},{true}} |1 |
To split the arrays use unnest and keep the order using WITH ORDINALITY AS
Finaly limit the result to rows with the identical ordinality, which I assume is the expected result, though differing from your output
with t as (
select
_id,
answer,
translate(subquestionid, '[]', '{}')::int[] subquestionid,
translate(subquestionanswer, '[]', '{}')::boolean[] subquestionanswer,
isactive
from test1
)
select
t._id,
t.answer,
a.subquestionid,
b.subquestionanswer,
t.isactive
from t
cross join lateral unnest(subquestionid) WITH ORDINALITY AS a(subquestionid, nr)
cross join lateral unnest(subquestionanswer) WITH ORDINALITY AS b(subquestionanswer, nr)
where a.nr = b.nr
_id|answer|subquestionid|subquestionanswer|isactive|
---+------+-------------+-----------------+--------+
1|true | 100|true |1 |
1|true | 101|false |1 |
1|true | 102|true |1 |
2|false | 101|false |1 |
2|false | 106|true |1 |
isActiveshould be abooleanandsubquestionidandsubquestionanswershould be normalized into a one-to-many relationship. But at least those columns should betext[]or maybe combined into a singlejsonbwhere the ID is the key and the flag is the value.